Questions tagged [error]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
9
votes
2answers
4k 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
240 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
8k 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 = ...
7
votes
3answers
4k 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 ...
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 ...
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-...
5
votes
2answers
2k 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
2answers
3k 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
1answer
368 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 ...
4
votes
1answer
288 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
3k 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; ...
4
votes
2answers
2k 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
2answers
6k 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 ...
3
votes
1answer
525 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
2k 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
913 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
1k 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
122 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
293 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
1k 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
0answers
494 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
2k 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 ...
2
votes
2answers
520 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
1answer
2k 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
3answers
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
1k 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
2answers
1k 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
2answers
49 views

Ethereum Wallet - Hangs at startup + 403 ws error

I have installed the Ethereum Wallet, Ethereum-Wallet-win64-0-11-1 (zip file), as described in the book. When I start up Ethereum Wallet (testnet Ropsten, syncmode “light”) the wallet seems to load ...
2
votes
1answer
1k views

Uniswap V2 smart contract integration reverts attempt at swapping ETH for tokens

I'm trying to integrate Uniswap V2 into my contract but my attempts at making a trade (ETH to Token) always gets reverted. Here is my solidity code: pragma solidity ^0.6.0; // Included the ...
2
votes
2answers
2k 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 "...
2
votes
1answer
45 views

Solidity. Find whether a key exists in a mapping. Then get its value

I have a simple mapping: mapping(address => string) professorsExam; How can I check if msg.sender is a key in this mapping, and if it is, get its value? If it isn't I should return something. ...
2
votes
1answer
241 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
30 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
1answer
222 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
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
344 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
0answers
26 views

Are there well-solved patterns and practices for handling errors in Solidity?

In the spirit of Are there well-solved and simple storage patterns for Solidity?... Are there known, battle-tested practices for how to deal with errors in large Solidity codebases? It's common in ...
2
votes
0answers
553 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
176 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
187 views

How to catch errors in web3.py

How can I catch revert or out of gas errors in web3.py? I'd like to call a function through web3.py and in case it gets reverted I'd like to try it again after a couple of seconds.
2
votes
0answers
233 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
157 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....
2
votes
1answer
140 views

Solidity IDE Parser Error on Token Name

Getting this in Solidity: browser/ballot.sol:121:16: Parser Error: Expected Primary Expression. Here is my code, says that it is the name line with the parser error function ERC20Token( ) { ...
1
vote
2answers
2k 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
1answer
804 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
536 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
1k views

assign decimal to a variable in solidity

I'm trying to calculate commission, but having a hard time doing a very easy math in Solidity. Ex: Commission = 5% Sales = 100 ETH 100 x 5% (0.05) = 5 ETH and in Solidity: uint sales = 100; ...
1
vote
1answer
648 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
426 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 ...