Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [contract-debugging]

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

2
votes
1answer
24 views

What is the best way to test calling a contract's function from another contract?

I'm playing around w/ Gnosis' MultiSigWallet and noticed in their replaceOwner function it has a modifier that requires msg.sender to be the MultiSigWallet contract itself: modifier onlyWallet() { ...
0
votes
0answers
28 views

contract cannot call other contract on Geth

I am using test PoA ethereum network by geth. When a transaction on contract tries to read or write other contract, the transaction seems to succeed but it is actually REVERTED. In this case, ...
0
votes
0answers
33 views

Gas estimation errored with the following message: VM Exception while processing transaction: invalid opcode

I am new to Solidity and am not sure why the following error is occurring: Gas estimation errored with the following message (see below). The transaction >execution will likely fail. Do you want ...
1
vote
1answer
16 views

error in msg.sender

I'm pretty new to this solidity thing, so don't expect me to not make some elementary mistakes. Here's the code: pragma solidity ^0.4.25; contract toss3D{ uint tossvalue = 0; uint targetBlock =...
-1
votes
1answer
71 views

Trying to figure out this 2 ETH smart contract quiz

Does anyone know whether this smart contract can be broken? Is there some trick behind this? https://etherscan.io/address/0xfc62a32da21052fb3086e8f68ad10a7118a98606
0
votes
0answers
18 views

Are Infura Contract Events Working For You ?

I noticed my contract event listener is not firing - I didn't change any code prior to it not working. Has anyone else seen contract events stop working today?
1
vote
1answer
15 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 ...
-2
votes
1answer
21 views

What other function calls can freeze a smart contract like the pause() function?

I'm learning to audit Ethereum smart contract code for clues if a smart contract can be frozen or not. Many smart contract creators claim their contracts are "unstoppable", but I'd like to know if ...
2
votes
1answer
37 views

Handling the String msg returned from revert() in solidity

This is my sample contract.. pragma solidity ^ 0.4.15; contract Sample{ struct Info { address pubKey; //key bytes32 Id; } mapping(address => Info) public userMap; // ...
2
votes
0answers
28 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 ...
1
vote
0answers
35 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 ...
2
votes
1answer
31 views

Remix: Gas required exceeds allowance or always failing transaction

I have a contract which has transferFrom function mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; mapping (address => bool) public ...
1
vote
1answer
19 views

Send eth from one account to another using transfer() function

I am trying to write a smart contract that will send eth from one account to another account : Contract Send { event Sent(address from, address to, uint amount ); function send(address _receiver,...
0
votes
0answers
12 views

Mithril installation: Warning messages and editing package.json

I am trying to install Mithril from the site: Mithril 1.1.6 From the instructions, I ran some commands but got warning messages. I don't know if I am going fine or not. PS C:\Users\HP> npm ...
0
votes
1answer
29 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 ...
0
votes
0answers
13 views

Probleme with updating struct through payable call with web3js. But works through remix

I have a function in my contract to which I want to send wei to, the contract should update the value in a struct and transfer the value to another address. Solidity code: function voteMeme(uint ...
1
vote
1answer
71 views

Buy token function does not work in crowd-sale smart contract

I am new to ethereum block-chain. I created a crowd-sale and ERC20 smart contract and deployed on rinkeby test network. The ERC20 token transfer function working fine. But when I check functionality ...
0
votes
2answers
85 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/...
0
votes
1answer
36 views

Smart Contract that can transfer ETH to other ETH Wallet (Owner of the Smart Contract)

I actually my partner created a Smart Contract which is able to create a new smart contract and send the proceeds. I'm quite new to Solidity unable to figure out a way to modify the smart contract to ...
0
votes
1answer
26 views

All functions not implemented error

I have a complex structure of various contracts using various interfaces in solidity. When I want to deploy the contract that runs all the others; I have the following error appearing in remix IDE: ...
1
vote
1answer
20 views

How to decoding transaction value from an input string? (a specific case)

I tried to decode an input string of an ethereum transaction, based on ERC20 ABI. ...
2
votes
0answers
238 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 ...
3
votes
2answers
80 views

How to create cryptocurrency coin for trading?

I want to create generate crypto currency coin for trading (buy and sell). So i have choosed ethereum public network to create my coin(deploy ERC token contract). What is different between coin and ...
2
votes
1answer
90 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; ...
1
vote
1answer
287 views

Invalid implicit conversion from address to contract

Im trying to import a contract and call its primary function via another contract. This seems to work in most cases but in this case i get the following error. localhost/tokenmarket/SecurityToken.sol:...
2
votes
1answer
57 views

Contract working on Javascript VM and not Web3 Provider, why?

Here is the code: Calling contract: pragma solidity ^0.4.24; contract Caller { address public called_address; constructor() public payable { } function set_address(address _addy)...
1
vote
0answers
38 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 ...
0
votes
2answers
38 views

ERC-20 token address on Rinkeby for testing

I am looking for addresses of ERC-20 tokens on Rinkeby in order to test my smart contract. I know that I can find a lot of them at https://rinkeby.etherscan.io/. However, it would be nicer if there ...
1
vote
2answers
56 views

Why Are These Values Not Immutable

I'm not sure what changed, but with the original contract, I could not change the values of the variables. Originally, I had tested storing values using the setSample() function a second time... then ...
1
vote
1answer
148 views

Returning Structs and Lists in Solidity

Is there a particular reason why Solidity prevents you from returning structs, lists and other data structures? I understand that it needs to be secure and allowing array/list access may mess with the ...
1
vote
1answer
42 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 ...
0
votes
2answers
39 views

Can code send ETH to user accounts?

I was watching a talk by Vitalik in DEVCON1 in which he says code can do three things one of them being code can send ETH to other contracts. But can it send ETH to users account as well? Attached is ...
0
votes
0answers
21 views

uint not getting added to contract uint array

I'm having trouble saving/reading back uint that I have written to a solidity contract. My factory can successfully create an Item contract and deploy it but when I try to retrieve the ids owned from ...
0
votes
0answers
17 views

How parameters encoded?

I have a function in smart contract: function ERC20Token(uint256 _initialAmount, string _tokenName, uint8 _decimalUnits) I am using web3j to encode the function with params (100, "KToken", 100) and ...
0
votes
0answers
92 views

web3 remix cannot deploy contract

I have a problem when deploying smart contracts on remix. When I click create, I can see that transactions are passing through, from the blockchain explorer. I clicked multiple times, and this is the ...
0
votes
2answers
189 views

Get array values in Truffle console

Is there a way to print the values of an array in my contract to a console (using truffle or geth for example)? Suppose this is my contract: contract MetaCoin { uint256[] public someNumbers; ...
0
votes
1answer
31 views

Contract structure for storing user application

I have a Nodejs application in which users fill up multiple forms and that data is saved to the centralized DB i.e MongoDB. Admin can review the user data and can push the user data to Blockchain to ...
0
votes
2answers
42 views

Token deployment for DAO

I have coded a token that has about 5000 addresses. With token balances in them Each of these addresses will release tokens at a controlled rate. I would like these tokens to represent shares and ...
0
votes
0answers
49 views

Listing all the smart contracts deployed on ethereum [duplicate]

I want to list all smart contracts deployed on a private Ethereum chain, using Nethereum, and also those which were deployed by a certain address. I have seen here and here but I cannot get anywhere ...
2
votes
1answer
55 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 --...
3
votes
0answers
51 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 ...
0
votes
0answers
58 views

My smart smart contract won't send to multiple addresses

I have experienced some difficulties in getting deployed multisend/airdrop smart contract to distribute tokens to multiple addresses by interacting with the main contract. Each time it failed. Kindly ...
1
vote
1answer
72 views

go-ethereum keccak256 multi value byte slice does not match solidity keccak256

I have a smart contract with the following function: function testHash( address _sender, uint8 _method, uint256 _number, uint256 _amount) public returns (bytes32) { ...
1
vote
2answers
75 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 > ...
0
votes
0answers
43 views

Debugging on ropsten

The ropsten chain is a pain to debug. The RPC won't work for the default MetaMask node. Is there any way to get debug traces on ropsten?
0
votes
1answer
199 views

Division/Percentages in Solidity (a workaround)

Division/percentages is a required part of many applications but is difficult to implement since fixed and ufixed are not supported yet in Solidity. I've come up with this workaround: pragma ...
0
votes
1answer
28 views

Unpredictable states error when refactoring smart contracts

Ethereum smart contract functions are limited to around 16 local variables. When they exceed that number, stack is too deep error is generated. The solution is to refactor the large functions into ...
2
votes
3answers
244 views

How does MetaMask's TRANSACTION DATA work? How to interact with smart contracts by only using MetaMask?

I have this source code pragma solidity ^0.4.21; // Relevant part of the CaptureTheEther contract. contract CaptureTheEther { mapping (address => bytes32) public nicknameOf; function ...
1
vote
2answers
115 views

Execution difference of method call in MainNet vs TestNet

I was looking at the new smart contracts submitted list on Etherscan to pass the afternoon, and I came across this one: https://etherscan.io/address/0x70bf9df6967dc96156e76cc43b928a7ef02e159a The ...
1
vote
0answers
55 views

Debug failing transaction on mainnet

We have a smart contract deployed on main net and some of the recent transactions have started failing. Any idea how we can start debugging the contract? Contract address: ...