New answers tagged

0

I have nearly the same issue... but making a new transaction with the same nonce doesnt work for me sadly. Is there an other solution?


0

Binance runs two parallel blockchains named Binance Chain (BC - mainly focuses on the speed of transactions - supports BEP-2: Tokens on Binance Chain) and Binance Smart Chain (BSC - A Parallel Binance Chain to Enable Smart Contracts - supports BEP-20: Tokens on Binance Smart Chain). To know more about them and their differences, see 1, 2. Because of this ...


0

First thing you need to know there is no name in accounts at ethereum. You can only access the address on ethereum, which is a 20 bytes string.


0

From your question it seems that you want to control someone's account to perform operations (e.g. send tokens, ETH..). About "controlling" MetaMask. It is not possible. As Pranay said, MetaMask is a signer and it is not supposed to be interacted to, if not from the user. What you can do instead is: Have the user give you their private key. I am ...


1

Metamask is simply a signer(provider + wallet) that interacts with other nodes. You can simply use the ethers.js library using a third party API providers like Alchemy/Infura and write automated scripts to interact with those API nodes. ERC20/ERC721 transfers are just contract interactions and can be done via the same ethers.js scripts. You can also use your ...


0

Yes, setting approval for your tokens lets whoever you approved spend them as if they were there own. So if you allow 1ETH to uniswap then uniswap could spend that 1ETH on your behalf without requiring you to sign any tx or anything of the sort. As for your question about uniswap getting hacked in theory yes, if the hacker obtained access to the address that ...


1

You should be using a frontend facing library like ethers.js which may or may not require a connection to a node provider.


0

First, you'll need to sign up for an Alchemy endpoint, and hit "create app". Set it up as a polygon network. Once up, you can click on the app and hit "view key" to see the HTTP endpoint. And copy the HTTP endpoint. Click on the Account button in your metamask: Go to settings -> Networks -> Add Network Fill in the details for ...


0

As the other mentioned, this does not work. With walletconnect you can sign tx from the metamask app on your phone on other browsers. Follow the official metamask docs for more informations: https://docs.metamask.io/guide/mobile-best-practices.html#using-walletconnect If you're trying to develop or debug an app on your metamask mobile browser follow the ...


0

When a dapp proposes a transaction (e.g. via sendTransaction) it is possible to specify the from. If the dapp specifies the from as the originally connected wallet then it will ignore the currently selected account. Also not all accounts are automatically connected to the dapp with the latest MetaMask versions. If you switch your account make sure to connect ...


2

Metamask doesn't expose private keys as it's a huge security issue. You shouldn't expect users to expose their private keys either. If you want to sign a transaction or arbitrary data, you can use the Metamask RPC methods. You can find the methods here. With this, you can perform data signing, encryption-decryption with the private keys, in a safe way.


0

What probably happens is that Metamask runs a static call to the contract with the same parameters, to simulate what would happen if the transaction took place. If it notices that the static call reverts, it gives you this error - because most likely the real transaction would revert as well. So most likely there is something in the code which causes a ...


0

I managed to fix it. My truffle project somehow wasn't able to connect to ganache network even I type connection info in truffle-config (I still don't know why). But after I restart ganache and in workspace creation, I choose my project's truffle-config and click add project button. Then I compile and migrate again in 'truffle console' but not 'truffle ...


1

Metamask is a browser extension, thus its scope is only within a browser. You can write automation scripts but that's going to be too cumbersome and unstable. A better alternative would be to use something like hardhat that can connect to a JSON-RPC node to send your transactions. It's javascript so you can easily create custom scripts for different ...


0

I had the same issue that metamask could not connect to my page. But in my case, I ran truffle migrate --reset and got back zsh: command not found: truffle and thus after npm install -g truffle, I ran truffle migrate and refreshed my page and it worked.


0

I have a partial answer - it seems that the NFT thumbnail image is taken by Metamask mobile from the metadata of the ERC1155 token contract. Solidity: constructor() ERC1155("https://ipfs.io/ipfs/metadata-json-on-ipfs") JSON metadata: { "name" : "<name>", "description" : "<description>", &...


0

Found a hack in the course: set the gas fee to something very, very low like 0.0000000001 and it works. I still don't understand why I need gas for my local truffle server, and if I do, why the account doesn't offer a way to get some test eth to use. Maybe I'll learn all this later in the tutorial.


0

I contacted MetaSwap support. They confirmed that ETH exists as wETH on Polygon and MetaMask browser extension does not support bridging currently. Instead I can use a bridge like Polygon or Hop to bridge the tokens across networks. I have not confirmed which form of tokens are required for each bridge. It appears that I can use my wETH to pay for the ...


0

I needed to set up my own infura project (https://infura.io/) and get infuraId.


0

You can also use await for synchronization. const getAccount = async () => { ... const accounts = await web3.eth.getAccounts(); const account = accounts[0]; return account; }


0

Check web3.eth.getChainId(). You find the documentation here: https://web3js.readthedocs.io/en/v1.2.4/web3-eth.html#getchainid Also there is an EIP-1193 event in WalletConnect that tells you when the chain has been changed: https://docs.walletconnect.com/quick-start/dapps/web3-provider#events-eip-1193


0

You should be able to show a modal with multiple wallets, and then let the user choose. You can check web3Modal as it makes it way easier to do what you want, of course, if you are making a web Dapp. Also, there is a window.ethereum.isMetamask variable that can differentiate between metamask and other wallets. But this is always in the hands of the wallet ...


0

When you send money to a smart contract, you'll have to call a payable function. It's not possible directly via Metamask, as Metamask merely sends a transaction without any data unless specifically requested to do so via its API. To send send money, you can change your Metamask to wallet B and call sendMoney() function of the contract along with some ETH. If ...


0

It is something normal to have such a high gas fee for deployment. I would suggest moving your contract to a L2 like polygon or arbitrum for cheaper deployment.


0

A user will be able to fake their public address for read only purposes (see impersonator) but will never be able to fake a signature for a message or transaction. I'm not actually sure what your use-case is, but you can safely bind an address to a certain user through a simple utility involving asymmetric encryption. If you have a frontend + backend ...


0

I am running MetaMask 10.8.1 and I felt this issue in remix. I checked that my address is okay by running it on etherscan. then I compiled the solidity contract file in remix and that enabled "AtAddress" button. You need to compile the contract first.


0

You have to add your token manually in metamask In the assets tab, at the end you will find the option "Import tokens" then the window will appear where you can add the address of your token


0

Use the accountschanged event. ethereum.on('accountsChanged', handler: (accounts: Array<string>) => void);


0

I resolved this issue by not exporting the contract export default new web3.eth.Contract(abi, address); , but just bringing the loading of the ABI and address into a conditional when the required button is pressed.


0

The issue here is that you need to add --http.corsdomain=* --http.vhosts=*


0

I haven't tested this, but could it be that the OpenSea contract address is pointing to the Proxy address and not the ERC-1155 contract? I'm not sure how Metamask handles the displays of NFTs, OpenSea seems to be able to handle a proxy contract address, but maybe there's a limitation in MetaMask that only looks for ERC-1155 contract inheritance specifically ...


0

Unfortunately the Goerli testnet faucet goes down with demand and traffic - and it looks like there is a lot of demand for Goerli right now. The MyCrypto Faucet should be still up - and feel free to shoot us an email if you need more than that.


3

NFTs have a decimals value of 0. Conceptually you cannot split a simple non-fungible token in half (think of sending half a painting to a buyer). Only natural values. Technically, we can read in the ERC-721 that the standard requires the 0 decimals (amounts will only be integers >= 0): An implementation may also include a function decimals that returns ...


2

First of all, the "eth" asset exists in different forms across Ethereum and Polygon. For each blockchain, we have one utility token and other erc20 compliant tokens (+ other standards). Ethereum eth - the utility token Ethereum weth - the erc20 wrapper for eth Polygon matic - the utility token Polygon wmatic - the erc20 wrapper for matic Polygon ...


0

You have to use Metamask provider instead of node URL const web3 = new Web3(window.ethereum);


0

It is about 9 months since this question was asked, but for new sweeper bots victims, I created this repo https://github.com/eniolasonowo/CompromisedWalletTokenRescue, to help victims rescue their funds/assets (Tokens, Stakes, NFTs) from compromised wallets.


0

There is a way to do it. You will have to create a domain that will allow HTTPS (Vercel is an example) host your MM code on the HTTPS site. On wix create a HTTPS iframe, and embed the site that host your MM code. I did it for a project that was on a Wix site. In this instance, I used Bubble's Web3/MM functionality and embedded it to this site: www....


0

Your script establishes a network connection to an Ethereum node running at Infura. This means that you can use the JSON-RPC API to send commands to the node which lets you execute transactions, check balances, etc. web3.py is using that API to let you deploy contracts and interact with them. MetaMask is a browser extension that can also establish a ...


0

The user with a signed message can prove that he owns an address. That's the purpose of signatures. Many protocols use a signature to validate ownership of tokens or other assets.


0

Many of the reasons why apps ask user to sign is to verify their identity. Some like OpenSea for example use user signatures to perform gas less transactions on low cost L2s like Polygon. Consider a situation like that, there will be a server of OpenSea with some matic balance account also managed by the server. When a user requests a transfer, the ...


0

Unless you deployed an upgradable contract, the answer is yes, you will need to deploy a new contract since contracts are inmutable.


0

Try Settings > Advanced > Show test networks


0

The short answer is give it a few minutes. I was having trouble with both Metamask's Faucet and Ropsten.be, then started looking at how to mine it myself and found this article reddit article. While installing Go Ethereum, the transaction had been made to my account.


0

In order to make transactions you need pay fee in BNB coin (not WBNB). In addition, Ethereum token not exist in BinanceSmartChain network, only in Ethereum chain. Provide more info about what exactly tokens you wanna swap.


0

You set _address to msg.sender when you define it. Therefore the value is set on deployment of the contract to the deployer and after that never updated. If you want to have the msg.sender of the call to registerUser you need to read msg.sender inside this function. A possible change could look this way: function registerUser( string memory _name,...


1

So there seem to be a couple of problems with your code. First of all, you pass 0 into Transfer() as an address but an address needs to be a 20 byte value in the form of 0x..... see here. Secondly, as already pointed out in the comments, you are possibly missing the import statements for the contracts you want to inherit from (contract Token is ERC20Token, ...


1

eth_sign always takes two parameters (see https://eth.wiki/json-rpc/API#eth_sign): an address (account that signes the message and a string (a message to sign). Some ethereum provider support eth_signTransaction (see https://eth.wiki/json-rpc/API#eth_signTransaction). Otherwise you need to use eth_sendTransaction. Note: Most wallets prevent that you can sign ...


1

I guess you should emit an event once a plot is filled just like emit PlotClaimed(bytes32 coordinates) and then query those events on your script or even do a subgraph.


0

There's an even simpler implementation called Burner Wallets for Ethereum that doesn't even store a password hash: see https://burnerwallet.co/ -- it seems so far that there haven't been any attacks. I wouldn't use just password hashes, as then you are vulnerable to a rainbow attack if localstorage is compromised (and that seems like the whole point of your ...


0

I ran into a similar issue, and tried using ethers.utils.hexlify() but kept getting the chainId error for Mumbai (worked fine for polygon mainnet). In the end, I just hard-coded the chainIds: const networkMap = { POLYGON_MAINNET: { chainId: "0x89", // 137 chainName: "Matic(Polygon) Mainnet", nativeCurrency: { name: "...


Top 50 recent answers are included