New answers tagged

0

From your screenshot there's no account Account: null So App.account is null and the contract fails because of that. Now Metamask requires user approval before returning the user's address From their docs you have to add a button and call ethereum.enable() Metamask will save the user decision so the user will be asked only once. Due to the async ...


0

So I assume you have Metamask. After that, you need to add the tokens that you have one by one using their contract address. if you don't know which tokens you have on your address, scan the address with https://ethplorer.io/ it will give you all the tokens you have, and their balance. after that, you need to add their addresses by clicking on the token ...


2

Syncing the Ethereum blockchain with Geth in --fast mode has two phases running in parallel: block sync and state trie download. Both phases need to be done in order to have a full node and switch to full mode where every transaction is executed and verified. The block sync downloads all the block information (header, transactions). This phase uses a lot of ...


1

If you can't synchronize now I don't think there is any trick to get it synchronized with your current sync mode. But various sync modes require different amounts of disk space so you could check those out - for example light sync might work for you. Clients get performance boosts every now and then with new versions so you can try updating to the latest ...


0

This is an old question but since no answer: the last number of the derivation path is to be changed to generate a new address: 0 is the first address, that you get with path m/44'/60'/0'/0/0, then use m/44'/60'/0'/0/1, then m/44'/60'/0'/0/2 ...


0

That's just how web3.js processes the data before handing it over to your application. It is quite useful in the sense that you can access it directly by name, for example: const ControlNumber = myEvent.returnValues.ControlNumber; And also iterate it sequentially using the __length__ field (which you forgot to mention): for (let i = 0; i < myEvent....


0

This is normal behavior. You can just now access your data either by index key returnedData.sender or index iteration returnedData[0] If you want to trim/supress this data, you have to do it on the client layer.


1

You cannot retrieve the original source code anymore, if no copy is available. The only way is to decompile the EVM bytecode to get a source code that is equivalent, but not equal to your original source code (it will look different but do the same). When you compile your Solidity code to EVM bytecode, the constructor is still included. After the contract ...


0

If someone has the same problem, the solution was to specify the amount of gas that I want for the transaction in the code, hope that will help someone :)


1

When you define a function's returns values, you have to use returns. functions getNumCandidates() public view returns(uint) However when you actually return the values, you have to use return. { return candidates.length; } Hence your code should look like: function getNumCandidate() public view returns(uint){ return candidates.length; }


0

One thing you could try is to update the line below this.state.contract.methods.add(0, this.state.username, this.state.email, this.state.password).call() To this: this.state.contract.methods.add(0, web3.utils.toHex(this.state.username), web3.utils.toHex(this.state.email), web3.utils.toHex(this.state.password)).call({from:"Your Account Address", gasPrice:...


0

The problem is by the use of .call() it will execute the function as a view, it will not make permanent changes. The correct way to make changes is to use .send() instead. contract.methods.addUser(...params).send({ from: userAddress });


0

Function send returns a Promise object which, when resolved, returns the transaction-receipt. The transaction-receipt contains all events emitted by your contract function (sendFunds). So first, save that Promise object: const promise = this.state.swapcontract.methods.sendFunds(address).send(...); Then, resolve it in order to get the receipt. You can do ...


0

Change this: boolean if_voted; address delegated_to; To this: bool voted; address delegate;


0

bool if_voted; try using 'bool' instead of 'boolean you should declare your struct 'Voter' as shown below, struct Voter { uint weight; bool voted; address delegate; uint vote; }


0

Other nodes simply don't care about the bad block and continue with some other block. The bad miner has two options: either continue mining on top of the bad block or try to mine a valid block. If he continues on top of the bad block no other node still won't accept any of those blocks as even if subsequent blocks are valid they are based on an invalid block ...


1

Both Rinkeby and Ropsten are public networks. But they are two different ethereum networks and have two seperate blockchains. By design, a blockchain Smart Contract cannot access any outside information other than what it receives by means of the signed payload which is the transaction that invoked this Smart Contract. The Smart Contract in a blockchain is ...


1

Yes, you can do it. You can create a Mintable / Burnable ERC-20 (Standard Fungible Token), and you can reward users by minting Tokens into their wallets. Users must first have an Ethereum Wallet. You can have a look to Open-Zeppelin to easily deploy an erc20.


0

When you first start up geth, you will see on the right on some line enode://[whatever]. Copy paste the enode with the enode part down to the ip. Now replace the local ip with your external ip, then go to your other node and in the JS console, type admin.addPeer("[the enode with the externalip]"). Please delete the [ and ]. They now should be connected


0

These would be steps Take Uniswap ABI and construct web3.Contract objects based on it Scan all AddLiquidity events from the block zero to the last mainnet block Build your own database/list of deposits based on these Here is some similar code to pick up all Transfer events for tokens: def scan_chunk(self, start_block, end_block) -> Set[str]: ...


Top 50 recent answers are included