Questions tagged [error]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
9
votes
2answers
3k views

Truffle + Infura on Mainnet: Nonce too low error

I have the following code: const Contract = artifacts.require('./Market.sol'); module.exports = async function(callback) { let instance = await Contract.deployed(); for(var i = 0; i <=200; i+...
8
votes
2answers
222 views

Possible error in white paper validation algorithm?

If we take the block validation algorithm described in the white paper (Section Blockchain and Mining), it states at point 6: Let TX be the block's transaction list, with n transactions. For all i ...
7
votes
2answers
2k views

Conversion of address to string in Solidity

The Solution given in Convert address to string did not help. Motive: To convert an address to string type so that I can use it as a parameter to a function for which string type is necessary. Code ...
6
votes
4answers
3k views

Truffle Box at URL https://github.com/truffle-box/bare-box.git doesn't exist

I'm trying to initialize a directory with truffle init, but I'm getting the following error: Error: Truffle Box at URL https://github.com/truffle-box/bare-box.git doesn't exist. If you believe this ...
5
votes
1answer
3k views

Web3ProviderEngine does not support synchronous requests while : Running migration: 2_deploy_contracts.js

I am new to all this, spent over 15hrs in the past 24 hrs to deploy based on directions here : https://blog.zeppelin.solutions/how-to-create-token-and-initial-coin-offering-contracts-using-truffle-...
4
votes
2answers
6k views

Solidity initialize memory array of fixed size

Using solidity 0.4.15, there is a function that takes a number and returns array of fixed length called traits: function splitN(uint256 n) constant returns (uint8[12]) { uint8[12] memory traits = ...
4
votes
2answers
2k views

errored: Error: gas required exceeds allowance or always failing transaction

Hi I have this error : transact to Roulette.betSingle errored: Error: gas required exceeds allowance or always failing transaction My programm : contract Roulette { uint public ...
4
votes
2answers
544 views

Solidity! Invalid implicit conversion from string memory to bytes memory requested

pragma solidity ^0.5 contract ProofOfExistence { // ... some code here function proofFor(string memory document) public view returns(bytes32) { return sha256(document); } //...
4
votes
1answer
255 views

Transaction using Metamask works. Fails with web3.py

I have two transaction, the first from MetaMask (everything is fine) https://etherscan.io/tx/0x1ab684f4875f8cc28043d9f3c3536a5e4f8a565cadda7a29bc6a96db5f1d0f8f the second using web3.py (it seems to ...
4
votes
1answer
2k views

Error: Operator == not compatible with types address and bytes32

How can I change the last line in the following code to make it work? contract University { address public owner; address public student; bytes32 fName; bytes32 lName; ...
3
votes
1answer
469 views

What is the advantage of using require instead of return or revert for error handling?

As is well documented, require is preferred over assert for error conditions, eg. Difference between require and assert and the difference between revert and throw Solidity might someday include the ...
3
votes
2answers
1k views

Consuming require() errors in web3.js client

Using require helps in validating user inputs before an action can be taken. However, it seems not many options exist to handle the scenario when require indeed returns false. The example mentioned in ...
3
votes
1answer
553 views

Truffle - Transfer leads to “Error: VM Exception while processing transaction: revert”

For reference, I am using Solidity to develop a smart contract for my company. I created a smart contract and attempted to use Truffle and Ganache to unit test it. However, I'm having a bit of an ...
3
votes
2answers
980 views

Uncaught ReferenceError: Web3 is not defined Solidity

I've been working with this project and I downloaded all dependencies and Web3 already but when I test my code it shows me this: Uncaught ReferenceError: Web3 is not defined in line 120. This is ...
3
votes
1answer
110 views

v0.4.22 solc compile failing - not predictable behavior

Error: Warning: Defining constructors as functions with the same name as the contract is deprecated. Use "constructor(...) { ... }" instead. function CappedCrowdsale(uint256 _cap) public { ^ (...
3
votes
1answer
268 views

DelcarationError: Undeclared identifier on token creation

getting this error, any assistance is greatly appreciated. browser/ballot.sol:166:17: DeclarationError: Undeclared identifier. require(_to != address(0)); ^-^ function mintToken(...
3
votes
2answers
788 views

What are the ways in which a transaction can fail and what happens when it fails?

What are the reasons transactions can fail and by this I mean all different types of transactions, i.e. payments EOA to EOA, contract function calls (from EOA or from other contracts) or other types ...
3
votes
2answers
701 views

Error! Unable to generate Contract ByteCode and ABI

Having issues verifying my token contract on etherscan.io. Receiving the following errors: Note: Contract was created during Txn# Result: Does not match the input creation bytecode found at this ...
3
votes
0answers
476 views

Why the transaction reverted?

Try to run my contract in remix JavaScriptVM and faced with error. Contract code: ... /** * @title Burnable Token * @dev Token that can be irreversibly burned (destroyed). */ contract ...
2
votes
2answers
5k views

Error starting protocol stack: datadir already used by another process

I noticed that geth stopped running on my system, so I tried restarting it but got the following error: Fatal: Error starting protocol stack: datadir already used by another process I checked whether ...
2
votes
2answers
143 views

Syntax Error: Type tuple(bool,bytes memory) is not implicitly convertible to expected type bool

I am trying to compile the following program: pragma solidity ^0.5.1; contract MKotET1_1{ address payable king; uint public claimPrice = 100; function calculateCompensation() public ...
2
votes
2answers
2k views

Unable to execute web3.eth.accounts[0]

I'm following along with this short tutorial and ran into a few problems. I'm running testrpc in my console. However, every time I run my index.html I get an error. My index.html file is the following:...
2
votes
1answer
827 views

Invalid bytes32 value [duplicate]

I am trying to learn about solidity so I just watch a tutorial about it, I already copy the same code as the tutorial but there is an error with bytes32. Here it is: That is the deploy code: And ...
2
votes
2answers
682 views

Pragma solidity not working

Dear all, I am very new to Ethereum, noob-new. This might anger many but, i have to ask, why is pragma solidity not functioning correctly. I have seem countless examples where pragma solidity ^0.4.0; ...
2
votes
1answer
576 views

Running out of gas during a deploy due to a large number of require() statements?

I have a smart contract that has a fair number of functions, but a large number of require() statements because I carefully check every incoming parameter and some intermediate calculation results too....
2
votes
1answer
21 views

I have a ParserError here “function Stratus(string _greeting) {”

pragma solidity ^0.4.19; contract Stratus { string public greeting; address public owner; event GreetingChanged (string oldGreeting, string newGreeting) function Stratus(string ...
2
votes
2answers
2k views

Invalid JSON RPC response when creating contract

I am getting this error while trying to deploy contract on Mainnet via remix.ethereum.org creation of XXXTokenCrowdsale errored: Invalid JSON RPC response: {"id":22,"jsonrpc":"2.0","error":{"code":-...
2
votes
1answer
279 views

What happens when a function call fails within my contract method?

I am mostly interested in the following aspects: does the entire stack get unwind? if the entire stack gets unwind does this lead to all the changes made to the state by the contract get reverted? do ...
2
votes
1answer
33 views

How does one retrieve revert/require error messages from RPC

In both of these questions, the user is asking if it's possible to get the error string from a revert or require. The answers say, basically, "Yes" and point to Truffle or other methods. VM Exception ...
2
votes
1answer
101 views

Metamask Error messages shows only revert

I have a little problem with the error messages I receive from MetaMask. In my dApp I have a modifiers which should throw an error with an error message. However, in MetaMask I only receive the RPC ...
2
votes
1answer
62 views

How to handle require/revert/assert errors properly

I'm trying to find an easy pattern to revert/rollback a write transaction. The first idea was to log a GenericErrorEvent but then I noticed that it will never be emited if any require/revert/assert ...
2
votes
0answers
330 views

Error when verifying signed message on Etherscan

Why is it that my message on etherscan can not be verified correctly? I always get this message: I'm sorry! Signature message verification failed
2
votes
1answer
121 views

Gas Estimation Error when I try to burn token

pragma solidity ^0.4.18; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. ...
2
votes
0answers
186 views

“queue limit” error

I try to deploy a smart contract and every time i receive "queue limit" error. Here is what i do: Web3 = require("web3") web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545")); ...
2
votes
0answers
154 views

How to get meaningful error msg from truffle unit test?

I am writing unit tests in truffle. No matter it's solidity unit tests or js unit tests, all of the error msg I can get is: Error: VM Exception while processing transaction: revert at Object....
1
vote
2answers
781 views

Solidity Compiler - Error: Identifier already declared

Full source code of the file 'Test.sol' : pragma solidity ^0.4.23; contract Mortal{ address owner; string ownerInfo = "Contract Owner name XYZ"; constructor () public { owner =...
1
vote
1answer
1k views

Contracts will not compile using truffle with the “emit” keyword included in front of events [duplicate]

I notice there has been changes made to solidity and that the word emit is now to be used in front of event triggers (to distinguish from functions being called). However when I include these in ...
1
vote
2answers
1k views

address payable type - store address and send later using Solidity 0.5.0

Solidity 0.5.0 has separated the "address" type into two types: address payable and address. Only address payable have the address.transfer method. I don't want to use the withdrawal mechanism. When ...
1
vote
1answer
484 views

Fatal: Error starting protocol stack: listen tcp: lookup ”localhost”: no such host

I'm trying to run a Node on a private blockchain using the following command: geth --datadir data/privateBlockchain/ -networkid 1234567 -port 30306 -nodiscover -rpc -rpcapi “db,personal,eth,net,web3,...
1
vote
1answer
251 views

Smart Contract to send ether

I have Solidity contract that is meant to send ether to someone. Unfortunately it's giving me a cryptic error message after I confirm the transaction in MetaMask. I'm testing on a local ethereum ...
1
vote
1answer
562 views

New Ganache (1.1.0-beta.0) Causes Invalid JSON RPC response

Hey I'm running a test where I expect a transaction to throw. Instead of successfully returning a receipt with a status of 0, or throwing a revert error, it throws this invalid JSON RPC response error....
1
vote
2answers
171 views

Calling an address array in web3 returns an error that the method needs arguments

I'm declaring a public address array in my contract, but when I call it, I get an error saying it's expecting an argument. Can someone shine a light on what is happening here? Contract.sol uint ...
1
vote
1answer
432 views

Error while installing web3

I'm getting these errors while executing npm install web3 How could i fix this?
1
vote
1answer
121 views

Ether transfer from Account to Account with smart contract doesn't work

I've been struggling for a whole day trying to figure out what's wrong with my smart contract but I couldn't sort it out. Any help is appreciated, I'm sure I'm missing something :( Here is my ...
1
vote
1answer
3k views

Encountered during contract execution [Reverted]

When trying to sent some ETH from myetherwallet getting followinf error: Warning! Error encountered during contract execution [Reverted] transaction links: https://etherscan.io/tx/...
1
vote
1answer
663 views

Parse Error Expected Pragma on remix

I am a beginner trying to run the following code on remix.ethereum.org pragma solidity ^0.4.19; function processData(uint num) returns (bool) { uint _number = num; if(num == _number) { ...
1
vote
2answers
1k views

vm exception while processing transaction : out of gas

I already read the other topics with the same error, but that didn't solve my problem ... When I try to communicate with test rpc between my web interface with my smart contract I have always error "...
1
vote
1answer
1k views

Error from web3.eth.getPastLogs() hex string without 0x prefix

I want to retrieve all token transfers to a given address by scanning the logs but receive an error. Am I doing something wrong? Could it be a web3 beta issue? Code: const Web3 = require('web3'); ...
1
vote
1answer
73 views

Function declared as view, but this expression (potentially) modifies the state requires payable

I'm trying to change the an address data variable to a one, which is selected via a function. Keep getting the below error. Function declared as view, but this expression (potentially) modifies the ...
1
vote
1answer
21 views

call: Warning: Unused local variable

I am trying to compile the following code: pragma solidity ^0.5.1; contract MKotET1_1{ address payable king; uint public claimPrice = 100; function calculateCompensation() public returns(uint)...