New answers tagged

1

Ganache allocates by default 10 accounts for private keys 0x000...1 thru 0x000...a. You obviously don't want to use these accounts in your actual deployment, because everybody knows these private keys, they are most likely continuously monitored, and whenever somebody transfers ether into any of them, it is transferred out of them sooner than later. You ...


0

You can use the navigation bar of the ganache GUI to know about the transactions and the blocks. I want to know the size of the generated block. In Ganache each block contains only one transaction and you can easily check yourself by navigating to the Blocks section. Also I want to know the time required to mine/generate/create a block after the ...


0

In case someone stumbles upon this, here is what i did to solve the issue. I made every name unique for each "form section" (unique header, form names, id...) and then referenced those. Some of the id's were not unique. I also used # to reference id's. <!DOCTYPE html> <html lang="en"> <body> <h4 id="candidateName"></...


0

Here is how I do it (tested with web3.js v1.2.1): const fs = require("fs"); const Web3 = require("web3"); const MIN_GAS_LIMIT = 100000; const CFG_FILE_NAME = "SomeFile.txt"; const NODE_ADDRESS = "YourNodeURL"; const PRIVATE_KEY = "YourPrivateKey"; const ARTIFACTS_DIR = __dirname + "/RelativePathToYourBinAndAbiFolder"; function get() { return JSON....


0

You first need to install MetaMask and chose the network you're willing to test on . then you need to connect to MetaMask. it will automatically go on the test network you have chosen. read the Metamask documentation and learn how to connect in here


1

Made it work, a piece of code was missing after the methods call. Here the complete call function from the browser console: simpleStorageInstance.methods.setValue(5).send({from: '(address)', gas: 3000000}); This sends the transaction that can be seen in ganache.


1

Ganache and Truffle are developer tools. MetaMask is a browser wallet. Geth is software for running an Ethereum node. Does that answer all questions? You might also want to have a look at https://soliditydeveloper.com/solidity-overview-2020/.


0

Note, the DappUniversity tutorials require Ganache or ganache-cli local blockchain running. Web3js is trying to connect to the local blockchain on this line: web3 = new Web3(new Web3.providers.HttpProvider('http://localhost:7545')); Go ahead and download Ganache here. You will also need to specify contractAddress & contractAbi. Ganache will give you ...


1

If you want to restrict it to at most 2 transfers, then you can do: uint256 public count; function () external payable { require(count < 2); count++; } If you want to restrict it to transfers from at most 2 different senders, then you can do: uint256 public count; mapping (address => bool) public senders; function () external payable { ...


1

This code is outdated. because MetaMask now need to have permission in order or get access to the user's MetaMask. Change this Code if (typeof web3 !== 'undefined') { // If a web3 instance is already provided by Meta Mask. App.web3Provider = web3.currentProvider; web3 = new Web3(web3.currentProvider); } else { // Specify default instance if no web3 ...


1

This are some rules I follow when verifying smart contracts Reentracy: Can a function be invoked by a third party while another function hasn't finished? This requires a function transferring control to another contract. Your contract doesn't make calls neither transfer ethers, so it shouldn't be exploitable by reentrancy issues. Front running: Does ...


Top 50 recent answers are included