Questions tagged [contract-debugging]

questions for finding and squashing bugs in smart contracts and decentralized development

134 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
5
votes
1answer
375 views

Can't debug transactions that fail during the Web3.js estimateGas() call? No Tx Hash

NOTE: I am doing my work with the Ganache v1.2.2 GUI client on a Linux Ubuntu 18.04 station. There are many revert errors that happen during the estimateGas() call that precedes the actual Web3.js ...
4
votes
0answers
202 views

Is it possible to trace a function call hitting revert?

It is possible to trace a transaction with debug_traceTransaction. But it needs the transaction hash, requiring it to be a transaction in first place. I'm debugging a function call that generates a ...
4
votes
0answers
206 views

Debugging smart contract with source trace

I am currently able to debug a tx with source trace in remix if I use my local geth node as rpc provider. The problem is that keeping a local node in sync is time and resource consuming. I am ...
4
votes
0answers
425 views

Event and/or watch does not work

I have a contract for a simple bidding scenario as below: pragma solidity ^0.4.9; /* Contract accepting biddings during 30 minutes */ contract SimpleBidding { address contractOwnersAccount; ...
3
votes
0answers
87 views

Getting error message from require() using golang, and go-ethereum?

From everything I've been able to find, the only way you can get the error message from require() is by using remix which isn't practical for dealing with production issues. Therefore, I'm wondering ...
3
votes
0answers
126 views

Why does this work with Solidity 0.4.21 but not 0.4.22?

I have this simple set of contracts. pragma solidity ^0.4.21; contract FirstContract { bool public isTrue = true; function sayHello() public pure returns(bool) { return true; } } ...
3
votes
0answers
138 views

How to configure parameter reexec of debug_traceTransaction?

I am trying to use debug_traceTransaction to scan the internal transactions of smart contracts, so I need set the value of reexec, what value should I use? It seems that reexec is the number of blocks ...
3
votes
0answers
631 views

How to use logx in Solidity?

Aim: To log data from a smart contract. Following function is written in accordance with low level interface to Logs in ethereum. However, due to lack of documentation, and being new in Solidity, I ...
3
votes
1answer
92 views

Non-specific error from truffle debugger

I am testing a contract which is using ecrecover function of solidity. While its testing when i go with a failed test case while debugging, it doesn't go step by step and at the end return the same ...
3
votes
2answers
271 views

Issue with autonomous contract calling erc20 token's transferFrom for approved amount

Trying to transfer fund using ERC20 token handle and calling 'transferFrom'. Assume that the specific amount is preapproved by owner account for 'MyContract' contract address. contract StandardToken {...
3
votes
0answers
126 views

Using Mix IDE on a private testnet?

Is it possible to run/debug contracts in mix-ide on a private test net?
3
votes
0answers
831 views

Tutorial on Ethereum wallet, create your token: strange behaviour

I've followed the tutorial here using ethereum-wallet (mist) 0.5.0. I'm running geth on a custom network launched as: geth --datadir ~/ethprivatechain/testing/01/ --networkid 42371325 --nodiscover --...
2
votes
0answers
37 views

How to simulate time increase in Remix IDE?

In my JavaScript tests: module.exports = { increaseTime: (duration) => { const id = Date.now(); return new Promise((resolve, reject) => { web3.currentProvider.send({ ...
2
votes
0answers
61 views

How to know the reason of transaction's reversion in parity?

I am testing ERC20 USDT contract locally with parity. I imported contract to my private testnet and manually generated raw transaction that calls "transfer" method of contract. I send it to the node ...
2
votes
0answers
43 views

Address to create a contract

This query is for informational purposes, with something that has had me in doubt all night. I am trying to send a self-signed transaction for the creation of a contract My Tx transaction to send is ...
2
votes
1answer
115 views

How to trace the line where a tx failed in truffle tests?

I know about 0x's sol-compiler and sol-trace. I used them before and they do exactly what I'm looking for, but these modules bring significant overhead when used with truffle. Check out this file to ...
2
votes
1answer
1k views

How to debug transaction from truffle test on development network

I am trying to debug a failing solidity function, which I am calling from the JS test files with truffle. When I run my test, I am successfully able to get a transaction id. However, my solidity ...
2
votes
0answers
619 views

Contract too large

I am sure this has already been answered but I could not find a clear answer. I get the following error: Contract creation initialization returns data with length of more than 24576 bytes. The ...
2
votes
1answer
411 views

call other contract's external function , the error: The contract code couldn't be stored, please check your gas amount

when I deploy a contract, the truffle frame told me this error :“The contract code couldn't be stored, please check your gas amount”。 the solidity code is: 1) Base.sol pragma solidity ^0.4.22; ...
2
votes
1answer
515 views

remix: The method debug_traceTransaction does not exist/is not available

I have followed this answer. So, you just need to add the --rpcapi "eth,net,web3,debug" command line option. The way I run my geth: geth --datadir /home/user/POA/private --rpcaddr 127.0.0.1 --...
2
votes
0answers
50 views

Why would a contract throw after it has executed the last line of code?

I'm debugging a contract function with Truffle. It always throws the following error: Error: VM Exception while processing transaction: revert However, I'm certain that the function has reached the ...
2
votes
0answers
250 views

Usage regarding for loop in solidity contract

I am trying to integrate for loop in my smartcontract for adding details to a struct. I have implemented for loop using frontend by calling the function in smartcontract one by one. struct details {...
2
votes
1answer
234 views

Creating contract issue. Contract keeps loading

I'm testing the process of creating an Ethereum contract using the Mist Rinkeby test Network. I used the code from an online tutorial, everything went fine, except at the creation of the contract. ...
2
votes
0answers
333 views

debug.traceTransaction(<transactionID>) returns a empty structLogs: []. What might be the reason?

On the comments here: https://ethereum.stackexchange.com/a/6011/4575 For a transaction to a contract, the contract vm instructions will execute and the steps are shown in the status.structLogs, ...
2
votes
0answers
918 views

TypeError: Cannot access member 'code' of undefined

I am new to geth command line for testnet in Windows. I got an error when trying to deploy this contract example ---------------------------------------------- source = "contract test { function ...
2
votes
0answers
97 views

VM jump when accessing statically set variables

Hey it seems I get a jump error when I try to access any variable not set through a parameter in the constructor. amountRaised is throwing a jump error below as I try to statically set the value. ...
2
votes
0answers
112 views

Minimal contract testing setup using truffle

This question is a follow up onto this one. I have tried following the suggestion in the answer of adding a done() method that fires when an error occurs (an exception is raised) but it doesn't when I ...
2
votes
0answers
435 views

Contract storage not being updated after sendTransaction

First of all, sorry about the code written in Portuguese. I have the following contract: contract GerenciadorBoletos { struct Boleto { uint codigoBarra; uint ...
1
vote
0answers
8 views

Is there any EVM debugger with a flexible UI layout available as of 2021?

Remix debugger seems to be pretty mature. But, its web-based interface makes it impossible to shuffle the block around. For example, I want to move the "Stack" section to the right sidebar ...
1
vote
0answers
31 views

Smart contract copying code beyong code length

I've seen a couple smart contracts (eg the contract decompiled in this answer) use this pattern: Code[Code.Length:Code.Length+x] This surprised me because I would expect Code.Length to mark the end of ...
1
vote
0answers
31 views

What's the difference between this.function() and function() in recursion?

I stumbled across some odd behavior that I can't explain regarding recursive functions in Solidity. As a note, I have attempted to run this on ganache in case it is actually ganache that is throwing ...
1
vote
0answers
51 views

What is the best practice to deploy local contracts for testing?

I am trying to developing smart contracts let use some Tokens and DeFi protocols like USDC, Compound, Uniswap, etc. Then if I need to testing locally, I need to deploy them in localhost blockchain (...
1
vote
2answers
284 views

Token Sale Smart Contract

I am new to Ethereium Block Chain and have been trying some code written in solidity as follows. pragma solidity ^0.5.0; import "./MyERC20Token.sol"; import "./ERC20Burnable.sol"; contract ...
1
vote
1answer
26 views

What are the ways to call a smart contract function during development?

What are the ways to call a smart contract function during development using Truffle simulated VM with a GUI interface (like Remix or EtherScan offer)? I know I could use CLI options like Truffle ...
1
vote
0answers
59 views

Cannot execute contract in non-intaractive scripts

I want to deploy and to execute ERC-20 contract on geth with non-interactive scripts. But, it seems that non-interactive scripts and console shows different results. Enviroment ubuntu 18.04(docker ...
1
vote
1answer
119 views

Token migration and IDEX smart contract problem

During a recent token migration from token A to token B, a large number of token A were held by a number of people in an IDEX address (where it was ready to trade). The IDEX address is part of a smart ...
1
vote
1answer
56 views

Using contract to create Child contracts (web3j Java wrapper)

I have a simple Parent contract that creates child contracts and stores their address. contract Parent { address[] public registry; function createChild () public { address newChild =...
1
vote
0answers
223 views

why .call() in Truffle did not return results as expected?

I'm deploying a contract to my private chain and try to call the contract's function. After I got in the geth console and finished deploy contract, I called the function but it doesn't work ...
1
vote
1answer
296 views

dApp index.html fails to load for dAppUniversity election application

Hit a brick wall with this. git clone https://github.com/dappuniversity/election The following is the Shell output I get when I npm run dev. I’m using the cloned project from GitHub but I’ve ...
1
vote
1answer
1k views

overflow/underflow issues?

pragma solidity 0.5.1; contract basics{ using SafeMath for *; uint time; address payable sender; uint amount; event moneySent(address s,uint a); mapping(address=>person) ...
1
vote
0answers
18 views

Understanding a simple online contract which seems not functional

I am writing to understand the functionality of this contract (https://etherscan.io/address/0x1f14b77e9f4844889fa63bc1e5180c8b90ec18db), this does not look even "functional" to me. Here is the ...
1
vote
2answers
56 views

Why is solidity throwing “Note: The constructor should be payable if you send value. ”, when clearly the issue is elsewhere?

I'm writing a contract on Remix that is able to deploy and track child contracts. Here are the 2 contracts: pragma solidity ^0.5.0; Contract Factory contract ContractFactory{ ChildContract[] ...
1
vote
0answers
61 views

state channel between smart contracts

In my scenario, there are data sellers and data buyers which might be persons or organizations. I would like to create a smart contract for data seller and another smart contract for data buyer where ...
1
vote
1answer
50 views

Ethereum Node I want to export transactions from a token

I have an Ethereum node running and I am wanting to export transaction history for a specific ERC20 token to a local database every 10 minutes. Does anyone have any suggestions on how they would do ...
1
vote
0answers
50 views

exception calling another contract method

I have tried this several ways. In the simpliest form, I put both contracts in the same file, and Im still getting an issue when I try and run this in the browser compiler remix. Also, I am using ...
1
vote
1answer
192 views

How to understand output of debug.trace

I have created a Private Ethereum network and I have deployed a contract in it.. Now I am trying to post a transaction in that contract but I m getting error that transaction has been reverted by EVM ...
1
vote
2answers
805 views

How can I debug a live contract on Testnet

I have posted a simple token contact on Ropsten and have a basic function to Buy tokens and now due to some error EVM is reverting the transaction .. https://ropsten.etherscan.io/tx/...
1
vote
0answers
126 views

Gas requirement of function client.<function_name>() high: infinite

I've tried fix that problem. but still i don't know what was wrong If someone can fix this problem, please save me. I'm still trying this. below sample code contract HelloWorld { uint private ...
1
vote
1answer
98 views

Not able to send Ether to contract

I am trying to send Ethers to a contract deployed on Ganache but I am getting VM Exception while processing transaction: revert, the same logic is able to transfer Ethers to other account. Following ...
1
vote
2answers
244 views

Failing transaction [not out of gas] but error during execution

My 2 assumptions of the problem: out of gas some failed require statement when calling mint I don't see these 2 because I made sure to send more than enough gas and that msg.value > ...