Skip to main content

Questions tagged [contract-debugging]

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

206 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
5 votes
0 answers
579 views

Solidity sourceMap and opcodes. No map entries for every code?

After compiling a simple contract, the output are these values: "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH1 0xF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP ...
Juan Ignacio Pérez Sacristán's user avatar
5 votes
1 answer
834 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 ...
Robert Oschler's user avatar
4 votes
0 answers
269 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({ ...
Mars Robertson's user avatar
4 votes
0 answers
356 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 ...
Ismael's user avatar
  • 30.5k
4 votes
0 answers
295 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 ...
Anton M's user avatar
  • 141
4 votes
0 answers
439 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; ...
Önder Gürcan's user avatar
3 votes
1 answer
17 views

How do I make a blanket statement to be notified if certain wallets mint?

I've been trying to come up with a way to track wallets and be notified when they 'mint'. The way i'm doing it now seems like it will only catch around 50% of all transactions due to the nature of the ...
oyxf's user avatar
  • 41
3 votes
0 answers
176 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 ...
hextet's user avatar
  • 1,583
3 votes
0 answers
361 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; } } ...
Rob Hitchens's user avatar
  • 55.4k
3 votes
0 answers
244 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 ...
Jack Xu's user avatar
  • 31
3 votes
0 answers
1k 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 ...
Karan's user avatar
  • 416
3 votes
1 answer
105 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 ...
Aniket's user avatar
  • 3,545
3 votes
0 answers
131 views

Using Mix IDE on a private testnet?

Is it possible to run/debug contracts in mix-ide on a private test net?
Sebi's user avatar
  • 5,284
3 votes
0 answers
841 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 --...
FilippoDN's user avatar
2 votes
1 answer
269 views

Solidity debugger in VS Code

Is there a good Solidity debugger out there for Foundry that gives you the same UX in VS code as when debugging a node.js app? Like local/state variables inspection, breakpoints, etc?
dNyrM's user avatar
  • 928
2 votes
0 answers
193 views

Debug Hardhat with Foundry

Can you debug a Hardhat project using Foundry? I know that doing Foundry tests on Hardhat is possible through their plugin, but is it possible to debug also?
dNyrM's user avatar
  • 928
2 votes
0 answers
123 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 ...
Oroffe's user avatar
  • 263
2 votes
0 answers
104 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 ...
user7362292's user avatar
2 votes
1 answer
250 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 ...
Paul Razvan Berg's user avatar
2 votes
1 answer
2k 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 ...
Zargoon's user avatar
  • 143
2 votes
0 answers
1k 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 ...
Philip Rutovitz's user avatar
2 votes
1 answer
926 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: Base.sol pragma solidity ^0.4.22; contract ...
J.Hao's user avatar
  • 51
2 votes
1 answer
5k 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 --...
alper's user avatar
  • 8,394
2 votes
0 answers
59 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 ...
Derek Chiang's user avatar
2 votes
0 answers
277 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 {...
Christa's user avatar
  • 53
2 votes
1 answer
245 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. ...
Yacine Bouakkaz's user avatar
2 votes
0 answers
494 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, ...
alper's user avatar
  • 8,394
2 votes
0 answers
1k 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 ...
MWH's user avatar
  • 363
2 votes
0 answers
106 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. ...
ethereal's user avatar
  • 1,805
2 votes
0 answers
118 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 ...
Sebi's user avatar
  • 5,284
2 votes
0 answers
463 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; ...
Henrique Barcelos's user avatar
2 votes
1 answer
1k views

Invalid number of arguments error for getter function with no passed arguments

I am receiving this error when trying to call the getUsers getter function from the contract below: Invalid number of arguments to Solidity function. Running on Truffle in develop mode. mapping (...
atc's user avatar
  • 128
1 vote
0 answers
18 views

which fork debugger to use?

what tool are you using to debug mainnet contracts. So doing a fork and be able to step into line by line (considering you have the source ofcourse), but doing it on live contract. I tried to use ...
Josip's user avatar
  • 53
1 vote
0 answers
36 views

Truffle console: debug not showing me the code line that reverts a transaction

I'm trying to deploy my own swap router on the development network. I've got a transaction hash which reverts. I'm calling truffle console and then, when I press enter I get undefined. I can't reach ...
Radek_pl's user avatar
  • 791
1 vote
0 answers
49 views

failed to deploy smart contract on my private network

I created a private network of POA, and I use clef to seal blocks like this: I have successfully run this chain becaues it can produce blocks and I can create transactions between 2 accounts, and ...
jds250's user avatar
  • 11
1 vote
0 answers
38 views

How to deploy a contract to the same address in testnet?

My code for deploying a contract import { ethers } from "hardhat"; async function main() { const CF = await ethers.getContractFactory('abc'); const c = await CF.deploy(); await c....
Camila326's user avatar
  • 115
1 vote
0 answers
182 views

Remix IDE runs every transaction twice in Remix VM - Mainnet fork (and Testnet forks)

I ran some unit tests in Remix IDE using the Remix VM - Merge. It works without any issues. As I needed the ERC-1820 registry contract I switched to Remix VM - Mainnet fork for the unit tests. Some ...
fish filet's user avatar
1 vote
2 answers
440 views

Error - reverted with reason string 'LOK'

i got "reverted with reason string 'LOK'" error when executing this code (on the 'router.exactInputSingle(params)' exactly ) , why and how to fix this error ?; contract UniswapV3FlashSwap { ...
adam mr's user avatar
  • 131
1 vote
1 answer
20 views

My payout function to lottery winners is failing. I'm storing the winners in an array and attempting to payout but getting reverts

the code: function payoutWinners() public payable { require(msg.value >= payoutOwed, "send more than what is owed"); for (uint i = 0; i < winningAddresses.length; ...
snejad123's user avatar
1 vote
0 answers
139 views

What's the best way to debug a smart contract for testing purposes?

I am getting the following error on a specific function when I try to send a transaction: Error: Transaction reverted: function returned an unexpected amount of data at SmartWallet._checkTokenType ...
Falcon Stakepool's user avatar
1 vote
0 answers
208 views

Handle multiple tokenURI in one NFT contract

I have a simple nft contract and I want to create mint functions that if you press one or another that tokenId is bound to a URI I decide. I already tried multiple ways to do it but I got an error ...
Pablo's user avatar
  • 11
1 vote
0 answers
179 views

ERC20 token scam

I'm curious to know if there are tools that can detect scam by directly analyzing the smartcontract of the ERC 20 token? How do tools like tokensniffer work?
Laurent's user avatar
  • 31
1 vote
0 answers
31 views

Issue with a smart contract not collecting tokens in the contract

So ive got a smart contract that i found from another ERC-20 network and now im trying to use it on binance smart chain and having an issue, The contract is a token that collects a certain amount of ...
KeelanB's user avatar
  • 11
1 vote
0 answers
139 views

Update HashMap within onERC721Received with Vyper

When a contract receives an NFT by calling safeTransferFrom, onERC721Received is automatically called on the receiving contract. I want to be able to update a Hashmap to record the address of the ...
Ryan's user avatar
  • 92
1 vote
1 answer
221 views

Initializing an array of contracts

I am just starting out with Solidity and I came across this code block meant to deploy a new contract and add the address to an array. Can someone please explain why the array is initialized this way? ...
Oyinbayode Akinleye's user avatar
1 vote
0 answers
150 views

How to implement ERC721Receiver with vyper v0.3.3

I am trying to implement a function, onERC721Received, using Vyper v0.3.3, that is called when an NFT is transferred to the contract using safeTransferFrom. According to the this ERC721 token standard,...
Ryan's user avatar
  • 92
1 vote
0 answers
174 views

Brownie: replacement transaction underpriced

I have a stuck transaction in brownie, when I try to deploy another contract I have this error: ValueError: replacement transaction underpriced my deployment code is like this: dev = accounts.add(...
user97483's user avatar
1 vote
0 answers
222 views

Store variables from Inline Assembly and use them after the block?

Unlike almost all examples of inline assembly usage, I would not like to immediately return the function after doing something in the assembly block. Rather, I would like to save the result to some ...
Ron Germano's user avatar
1 vote
0 answers
1k views

Uncaught (in promise) Error: Internal JSON-RPC error. { "code": -32000, "message": "Execution reverted", "data": "0x" }

After getting the contract I tried to call a function from the deployed contract Address. But it is giving me the following error: Uncaught (in promise) Error: Internal JSON-RPC error. { "code&...
Ketul s's user avatar
  • 11
1 vote
0 answers
115 views

Web3js get event logs with call (without sending real transaction)

I need to predict which event logs will be emitted by sending a transaction to my contract, but without sending a real transaction, for exemple by using the call method of my contract (using web3). I ...
La Gregance's user avatar

1
2 3 4 5