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

0
votes
0answers
6 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
0answers
7 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
7 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
49 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
42 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
23 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
16 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
16 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. ...
1
vote
0answers
111 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
70 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
62 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
35 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
36 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
32 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
1answer
22 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
41 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
75 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
33 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
29 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
17 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
11 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
66 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
0answers
13 views

@param _toAddresses quesion

Is there anyway to increase the * @param _toAddresses The addresses of the recipients (MAX 255) * @param _amounts The amounts of tokens to be transferred Instead of 255, can it be increased to ...
0
votes
2answers
100 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
29 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
37 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
43 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
41 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
42 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
41 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
60 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
53 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
38 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
124 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
22 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 ...
0
votes
2answers
169 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
82 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
43 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: ...
0
votes
1answer
75 views

Get contract bytecode and creator from contract address on Geth console

I can get contract bytecode and it's creator via this URL. https://etherscan.io/address/CONTRACT_ADDRESS [example: https://etherscan.io/address/0x5a3e58c7cf09217d2a5385bf96c02673ed1187bb#code] I ...
3
votes
0answers
66 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; } } ...
0
votes
0answers
48 views

How does adminClaimAirdropMultiple work?

It was written as function adminClaimAirdropMultiple(address[] _addresses, uint _amount) public onlyOwner { for (uint i = 0; i < _addresses.length; i++) doAirdrop(_addresses[i], ...
1
vote
1answer
44 views

Constructor Arguments ABI-encoded - verification not working!

I think I must be going blind or something because I can not find the Constructor Arguments for this smart contract 0x3a2F46b0B0c187B152Db0c658b27E693f0A273a1 I have tried a number of options but ...
1
vote
0answers
33 views

help with fixing reverting token contract [closed]

I have been trying to interact with a smart contract deployed on the ropsten test network but have a problem sending ethers in exchange for tokens ( Transaction reverted: Error in contract code). ...
1
vote
1answer
34 views

Run contracts and create traces with Node

I came across an article: https://wanderer.github.io/ethereum/nodejs/code/2014/08/12/running-contracts-with-vm/ At the bottom of the page is shown how to write a contract execution route. But ...
0
votes
1answer
50 views

Trouble with libraries (Remix)

Tried out libraries for the first time, had a really bad experience with them. I need some help in getting my contracts to work between libraries. Library 1: pragma solidity ^0.4.0; library ...
0
votes
1answer
135 views

Truffle web3.eth.sign produces wrong signature

Somehow truffle produces an invalid signature. To clarify this I imported the private key of the first Ganache account to metamask and compared the results. The following code used in a chrome ...
2
votes
1answer
24 views

Event not exactly working (Inexperienced OP)

pragma solidity ^0.4.0; contract CustodialContract{ address client; bool public _switch = false; event UpdateStatus(string _msg); event UserStatus(string _msg, address user, uint ...
0
votes
1answer
47 views

Is there a way of inspecting msg.value and msg.sender in remix IDE?

I'm playing with re-entrancy business: https://medium.com/@gus_tavo_guim/reentrancy-attack-on-smart-contracts-how-to-identify-the-exploitable-and-an-example-of-an-attack-4470a2d8dfe4 Just curious if ...
0
votes
1answer
46 views

Transactions confirmation

I am using geth --dev --ipcpath ~/.ethereum/geth.ipc --minerthreads=5 console to run privatenet. So i use Etherium wallet to interact with it. The problem is that i need to do some transfer ...
1
vote
2answers
41 views

How to use a date time from an API to prevent contract interactions if the date is a string?

I want an to use an oracle to prevent contract interaction after certain time cutoffs This is the APIs format: "event":"event2","timezone":"UTC+1","datetime":"2018-06-07 01:00:00" I think doing all ...