The Stack Overflow podcast is back! Listen to an interview with our new CEO.

New answers tagged

0

As suggested here, log out of your metamask, switch your network to localhost 8545 (this option is already available) and then sign in using your ganache's mnemonic.


0

Try reinstalling MetaMask on firefox. Sometimes it is just a bit buggy.


0

This might work: MetaMask settings -> Advanced -> Reset Account.


1

If I make this function without payable and don't take any money from the caller then return value accurately returns me the code. You are on the right track but misinterpreting what you see. I'll break it down. accurately returns me the code I think you mean returns(string memory). without payable Payable has nothing to do with it. You have to ...


0

Inside Purchase smart contract define counters for the total number of buyers and the total earnings like this: contract Purchase { uint public totalBuyers = 0; uint public totalEarnings = 0; ... } Then, when purchase is confirmed, increase these counters appropriately: function confrimReceived() public condition(msg.value == price) payable { ...


1

To see your token balance in metamask, you has to add your ERC20 token address in metamask. ->Click menu in top left corner of metamask popup ->Click 'Add Token' ->Select custom token and paste your token address in given field ->Then click next and after that click 'Add tokens' Now token balance for your address will be displayed on metamask and you can ...


0

Copying the private key only (field ciphertext of the UTC file) will give two different public addresses (one in geth and another in metamask). To solve this problem import de UTC file (present in the node keystore folder) directly in metamask. When importing a file in metamask, make sure that you have the extension (metamask) running in it's own tab, ...


0

You'll need to save / backup your seed words (12 random english words that are in your Metamask settings) from your desktop, and import them into your mobile metamask. Better yet, ask Compound to support a web wallet that is backed up remotely (e.g. Portis, Fortmatic, Torus, or Democracy)


0

not sure what you ended up doing here, but when I ran into a similar issue, I decided to put web3 into my selectors. That was important because the Provider URL could change over time, so I wanted to make sure that Web3 always had the most up-to-date value from the Redux store. The big perk of doing this as a selector is that you don't need to worry about ...


0

you can try web3-hdwallet-provider to sign transactions for addresses derived from a 12-word mnemonic. const Web3 = require('web3'); const Web3HDWalletProvider = require('web3-hdwallet-provider'); const httpProvider = new Web3.providers.HttpProvider('InfuraUrl'); const mnemonic = 'YOUR PRIVATE KEY'; const web3 = new Web3HDWalletProvider(mnemonic, ...


0

To get access to the private key for using web3.js or pyethereum, uou need to export it from Metamask, by clicking the "..." next to the account name, choose "Account Settings" and scrolling down until you see a box labeled "Private Key". Use that as the key variable in the pyethereum example above, and be careful not to remove it afterwards and not to share ...


0

It is probably because there are some array iterables which are going out of range. Invalid opcode error comes only in this case (For me though). New to blockchain and smart contracts!!! Correct me if I'm wrong.


1

Infura is a public hosted node. It has no way to unlock your local accounts. Even if there was a way, it would be a security risk because anyone can connect to the same node and transfer your funds. In order to send a transaction over Infura you will need to sign the transaction locally using web3.eth.sendRawTransaction(). The following example is from the ...


0

In case it helps amplify Ismael's answer. An unbounded iteration is an anti-western because it doesn't scale. The fatal flaw is warned about here: https://blog.b9lab.com/getting-loopy-with-solidity-1d51794622ad You need a storage pattern that will ensure consistent gas cost at any scale, a.k.a. O(1) complexity. A general-purpose solution is described here: ...


2

To "speed up a transaction" there's only one possible option: to send a new transaction with higher gas price but with the same nonce. This way if nodes see both of the transactions they will most likely pick up the one with the higher gas price and once that is mined the other transaction becomes invalid (a tx with that nonce has already been mined) and is ...


0

It's simple , metmask -> networks -> Custom RPC Set network Name : MyNetwork , New RPC URL : 127.0.0.1:7545 ( 7545 is my ganache port number ) Save Now you are connected to ganache-GUI


Top 50 recent answers are included