Questions tagged [contract-debugging]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
13 views

Change TUSD smart contract from legacy to current [closed]

I have a Qty of TUSD token which runs on ETH however it was in Coinbase and I forgot about it for a long time till now, the problem is that Coinbase has stopped supporting this token before the ...
0
votes
1answer
8 views

Find a Function Call Across All Contract Transactions

Is it possible to search for a particular function call across all transactions of a smart contract? I'm doing due diligence on 1inch's smart contract in order to see if renounceOwnership was called ...
0
votes
0answers
33 views

When trying to sent token Xcel from myetherwallet getting followinf error:

Blockquote Warning! Error encountered during contract execution [Reverted] transaction links: https://etherscan.io/tx/0x7defc28fc1d4e2fce209891370f0d4edc28d386da05a7ef944150cf9b4f81841 https://...
0
votes
0answers
18 views

Step by step smartcontract debugging with truffle or brownie

I am writing smart-contracts with Vyper/Brownie or Solidity/Truffle. In order to debug and test my smartcontracts, i want to execute them step by step. Is there a way to do that exactly like we debug ...
0
votes
0answers
18 views

Is it possible for an attacker to exploit contracts that rely on incoming “msg.value”?

I am developing an eth2.0 fuzzer for my masters that has produced some interesting crashes - if these crashes are legitimate I believe I may have found a new vulnerability - otherwise, I still have a ...
0
votes
0answers
82 views

ParserError: Expected ';' but got '{' (bool success, ) = recipient.call{ value: amount }(“”);

pragma solidity ^0.6.0; library Address { function isContract(address account) internal view returns (bool) { // According to EIP-1052, 0x0 is the value returned for not-yet created ...
0
votes
1answer
17 views

how can I make function of another contract callable?

Obviously there is a problem with the deploy procedure or the remix IDE, but how can I make the function callable? pragma solidity> = 0.5.0 <0.6.0; import'openzeppelin-solidity / contracts / ...
0
votes
1answer
24 views

How to returns fixed length array in solidity

I get the following error, how to resolve it? Expected type name function Array_Data () public view returns (memory uint []) {^ ---- ^. pragma solidity >=0.5.0 <0.6.0; contract Lock { uint[...
0
votes
1answer
102 views

ParserError: Function, variable, struct or modifier declaration expected. ^

pragma solidity >=0.5.0 <0.6.0; import 'openzeppelin-solidity/contracts/token/ERC20/ERC20.sol'; contract NautCoin is ERC20 { // string public constant name = 'NautCoin'; // string public ...
0
votes
0answers
12 views

estimateGasPrice succeeds but sending a transaction fails?

I have a simple contract with a function (simplified for the sake of discussion): function test(address tokenAddress, address userAddress) external { IERC20 token = IERC20(tokenAddress); ...
0
votes
0answers
7 views

Is there any solidity IDE where we can break and check variable in VB style

I am looking for a solidity IDE where I can break code execution in the middle and see variables value using mouse over the variable-text as in visual basic
0
votes
1answer
8 views

Implementing Forwarder to Contract

I am using this code for implementing Forwarder in my Contract. contract Forward { address public destinationAddress; event LogForwarded(address indexed sender, uint amount); event LogFlushed(...
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 ...
0
votes
0answers
30 views

UniSwapV2Router.sol contract failing - “Gas required exceed allowance / Always failing transaction”

I am trying to recreate the Sushiswap protocol for educational reasons, but I am stumbling into an issue. When I try to run the addLiquidity function inside the UniswapV2Router.sol contract with the ...
0
votes
1answer
52 views

variables does not change while set before calling _addr.call(abi.encodeWithSignature(…))

I call a function of 1icnh smart contract named "getExpectedReturn" inside my contract's function. when I set a variable (named v1) before the call, the variable does not change but if I set ...
0
votes
1answer
21 views

Unable to approve [closed]

/// pragma solidity ^0.6.0; import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/IERC20.sol"; import "https://github.com/OpenZeppelin/...
0
votes
0answers
22 views

Are assertions removed in release build?

Are assert() removed in release build? Please show an authoritative document documenting that they are removed or no removed.
2
votes
0answers
35 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({ ...
1
vote
1answer
28 views

How is caller's data related to bytecode?

I know that smart contract is deployed as bytecode. When we call a function from application, we use the encoding with the help of ABI and we get some bytes. let's say 220 bytes. These are the bytes ...
1
vote
1answer
215 views

contract inline assembly - return array parts by using assembly

I've a couple of questions. mload function returns the data that resides on the address we pass to mload. Is this correct ? add function is used to give us the address from 0 to whatever we pass. ...
0
votes
1answer
25 views

why separate assignments are better than single?

I've read that: It is more gas efficient to initialize a tightly packed struct with separate assignments instead of a single assignment. Separate assignments makes it easier for the optimizer to ...
0
votes
0answers
15 views

howt to generate AST tree form (not in JSON form) from Solidity File (.sol)

I have .sol file and want to generate AST only from .sol file. My scenario is that at the command line (after installation some package), I just have to give a command like package_command --AST [from ...
0
votes
0answers
31 views

Problem Uploading Contract Verification to Etherscan - Contract works perfectly and is already deployed

BOUNTY WILL BE GIVEN FOR SOLUTION I am having trouble authenticating my ERC-20 Token Contract on Etherscan. Token works perfectly and all functions are correct I am a novice dev and lead dev of ...
0
votes
2answers
128 views

Stuck ETH in Smart Contract

Can somebody please help me? Created and deployed a smart contract and now ETH is stuck in it and won’t show in the creator’s account. any way to get it using the creator’s PK? Need help so badly, ...
0
votes
0answers
17 views

How to find whether a call in debug trace has out of gas error?

In the debug trace of a transaction collected using debug_traceTransaction, how can we know that an internal call was terminated because of out of gas error? Specifically, when a send() is used to ...
0
votes
1answer
26 views

Auction project in Solidity: Why do I get “VM error: invalid opcode” for this code?

I am trying to do an Auction project and this part is bugging me. I can't figure out what is the problem that's causing the following error message: "VM error: invalid opcode.". Even if I do ...
0
votes
2answers
26 views

Token Access Issue

Hi Sir we Create Token but we cloud'n have full access on Tokens. Like we create 2000M Token but when I add it in my Metamask I got only 200M Tokens. Cloud you please me out for this?
0
votes
1answer
256 views

How to estimate gasLimit of ERC20 contracts in web3.php project?

I am using web3.php project in my Ethereum based project. A part of this project is sending ERC20 tokens, and in this regard, I need to estimate gas limit of transaction. For this purpose, I found the ...
0
votes
2answers
124 views

solidity, how to wait n second function or others solution

I am working on a project for p2p energy trading using blockchain. I am building an experiment on my own to demonstrate the concept for my master thesis. For this project I have two python scripts, ...
0
votes
1answer
328 views

How to withdraw Other ERC20 tokens besides Ethereum from my contract

I'm trying to implement something like this (which works) function withdraw() public { msg.sender.transfer(address(this).balance) } but I need to be able to withdraw ERC20 tokens other than ...
2
votes
1answer
232 views

Why doesn't the solidity perform rounding off to nearest whole number

The function getInt() is always returning more than 1. Shouldn't it do a round off for values less than 0.5 and return 0 ? Please check the image and let me know, if I am doing something incorrectly ...
0
votes
2answers
602 views

How to debug a “rpc error with payload”

Debugging smart contract errors can be surprisingly hard. There is one particular kind of error that annoys me the most: the infamous rpc error with payload. For instance, just a few hours ago, while ...
0
votes
1answer
160 views

ParserError: Expected ',' but got ';'

I`m trying compilate this code and getting Parse error pragma solidity ^0.6.0; contract ZooFactory { event NewZoo(uint zooId, string name, uint dna); uint dnaDigits = 24; uint ...
0
votes
1answer
64 views

What are the flaws of this example contract?

I am currently writing a paper/article on tokenization, in the beginning of which I introduce smart contracts. To this end, I present the following contract as an example: pragma solidity ^0.6.0; ...
1
vote
0answers
44 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 (...
0
votes
1answer
82 views

Are these BTCQ tokens sent to contract properly locked?

In the case of this contract code, all the tokens sent to the contract are forever locked? Were they effectively burned? I don't see any function like the solutions offered in this question, and I ...
0
votes
0answers
49 views

Transaction halted with a RUNTIME ERROR

while debugging I encountered this error: There was no revert message. This may be due to an in intentional halting expression, such as assert(), revert(), or require(), or could be due to an ...
2
votes
0answers
57 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 ...
1
vote
1answer
25 views

How to get active users of Dapp [closed]

Is it possible to have unique constraint on parameters of an event? I will have a number of users using my Dapp, and I have provided functionality to delete the users. So while reading from the ...
2
votes
3answers
464 views

simulate transaction without sending to blockchain

Is there any way to simulate a transaction without sending it to the blockchain and find the exact error (or line of code), in case it fails if its mined?
0
votes
1answer
21 views

Recover parameters from failed transaction on etherescan

I have some failed transactions on etherscan that I'd like to investigate. An example is this one. How do I convert inputs like 00000000000000000000000000000000000000000000000000000001ae43e5e0 to what ...
0
votes
1answer
76 views

find the exact error in solidity transaction programmatically

I know we can detect that the transaction is going to be failed with the "Out of gas" warning beforehand but is it possible to find the exact error before sending it to the blockchain. How can we ...
0
votes
1answer
34 views

Getting a, “ReferenceError: artificats is not defined” - Error running a simple “approver” test

(Working from the Lynda Ethereum course) Running the test code below I get the following error: truffle tests Warning: Both truffle-config.js and truffle.js were found. Using truffle-config.js. ...
0
votes
1answer
27 views

“TypeError” for a simple program causing failure to compile, “Type address is not implicitly convertible to expected type address payable.”

This is my first contract (working from Lynda course). Even when I use the supplied code I still age this error for the following code with I try to compile: TypeError: Type address is not implicitly ...
1
vote
1answer
30 views

Information Regarding LASER and Ethereum

I was reading this article https://diligence.consensys.net/files/D1T2%20-%20Bernhard%20Mueller%20-%20Smashing%20Ethereum%20Smart%20Contracts%20for%20Fun%20and%20ACTUAL%20Profit.pdf and came across ...
1
vote
2answers
155 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 ...
0
votes
1answer
25 views

Testing Smart Contract with multiple clients

After deploying a smart contract on Ropsten Testnet using Truffle framework, we can use truffle tests to do unit testing (create a client to interact with the deployed contract). My question is, how ...
0
votes
2answers
632 views

How to diagnose a “Error: Transaction has been reverted by the EVM”?

This the error intercepted from my javascript, using web3.js Error: Transaction has been reverted by the EVM: { "blockHash": "...
2
votes
1answer
249 views

Getting an 'invalid opcode' calling a solidty function from test file

im in the process of learning about ethereum and Solidity, and im having a problem calling a payable function from a test file. This is my contract pragma solidity >=0.4.22 <0.6.0; //pragma ...
3
votes
3answers
78 views

Revising Smart Contracts [closed]

If I create a Smart Contract that pays users for sharing their data, how can I ever update this smart contract in the case it has an error, or perhaps I wish to change the amount paid for data sharing?...

1
2 3 4 5
11