Stack Exchange Network

Stack Exchange network consists of 175 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
1answer
23 views

What DSAuthority(0) and eos.owner() means and does?

In ERC20 EOS crowdsale contract, what these three lines(469-471) does? function initialize(DSToken eos) auth { assert(address(EOS) == address(0)); //[Someone explained this line here][...
1
vote
1answer
32 views

Debugging a failed transaction

I have a smart contract deployed to mainnet. A user has executed a transaction that resulted in a revert failure. How can I debug this transaction to determine what exactly happened that resulted in ...
2
votes
1answer
44 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 ...
0
votes
0answers
27 views

Get the result back of a smart contract function call using INFURA

This is the function I use to send a signed transaction using Infura to invoke a smart contrac function (see details for the params of the transaction). web3.eth.sendSignedTransaction('0x' + ...
0
votes
0answers
41 views

How to make smart contract call using INFURA and NodeJS web3js

I can not understand how I can prepare the transaction to be signed. Because INFURA does not support eth_sendTransaction but only eth_sendRawTransaction (INFURA API which then requires you to prepare ...
0
votes
0answers
13 views

Hot to debug a contract method invocation?

Running this code: PrintProofOfWork.methods.printRequested(gcodeHash).send({from: web3.eth.defaultAccount}) .then((result) => { console.log(`result of the invocation: ${...
0
votes
0answers
18 views

Myetherwallet Balances?

I was testing on (Ropsten) Myetherwallet, everything was fine yesterday morning, then that evening, my balances (Ropsten Ether and Tokens) would not show. I was getting "(error_21) Not a valid ERC-...
0
votes
1answer
23 views

Remix uploading the wrong contract?

I have a contract called bridgeStacked that uses a library called BytesLib. When I have both loaded into Remix, I compile and deploy bridgeStacked from in Remix. First, I notice that in the log it ...
0
votes
1answer
17 views

Allow all ERC20?

So far a user can allow a smart contract or any address on Ethereum blockchain to spend their coins by calling the 'approve' function. If I want to allow address X to spend 250 of my FabulousCoins I ...
0
votes
1answer
15 views

i got error in if statement while i using the solidity version 0.5.0;

pragma solidity ^0.5.0; ... function SearchByTenderId(string memory a) public view returns(string){ string memory Id=a; if(keccak256(TenderId) == keccak256(Id)){ return "TenderId is ...
-2
votes
1answer
44 views

ParserError: Expected '(' but got identifier function OrderItem(uint _itemid, string _itemname) public returns(address){

browser/Logistics.sol:60:14: ParserError: Expected '(' but got identifier function OrderItem(uint _itemid, string _itemname) public returns(address){ ^-------^ pragma solidity ^0.4....
-1
votes
1answer
53 views

Getting error as Member “balance” not found or not visible after argument-dependent lookup in contract Lottery

I am trying one Lottery contract in that I am using one function which give me error. function pickAWinner() public restricted { require(this.balance >= 10 ether); uint index = random() % ...
0
votes
0answers
40 views

getting error solidity-member-transfer-not-found-or-not-visible-after-argument-dependent

I am trying to create one contract for Lottary app however I am getting error as " browser/test.sol:103:9: TypeError: Member "transfer" not found or not visible after argument-dependent lookup in ...
0
votes
1answer
47 views

Getting error : Error encoding arguments: SyntaxError: Unexpected number in JSON at position 47

While developing a Smart Contract with Solidity on Remix, after creating the contract I'm trying to calling function setGrantAddress: mapping (address => uint256) public balanceOf; but when I call ...
2
votes
1answer
21 views

UnimplementedFeatureError: Only byte arrays can be encoded from calldata currently

I received the error message UnimplementedFeatureError: Only byte arrays can be encoded from calldata currently from the compiler, but without any reference to a file or line. In a big project, and ...
0
votes
3answers
42 views

Owner is returned as 0x0000 … , what should I do?

I am a japanese student. I am studying ethereum. pragma solidity ^ 0.4.18; contract Owned { address public owner; // contract owner // / modifier for access check modifier onlyOwner () { ...
4
votes
3answers
56 views

Can a “forward” smart contract forward the received ether to another “forward” smart contract which forwards it to an address?

I am pretty new to solidity. I am trying to create a smart contract which deploys another smart contract and transfers ether to the newly created contract when a payment greater than 0.01 ether is ...
0
votes
1answer
24 views

i want to get data from the transaction hash i tried many codes at last i am getting boxes in the output

1) First, I got the input console.log(web3.eth.getTransaction('0x725fc75264726f409793164e336e7d5ed35df8d2be469a0cc1a3a8cc4756b9b9').then((i) => console.log(i) )); 2) I manually pasted the input ...
0
votes
3answers
57 views

Use function return variable of smart contract in web3.py

since im new to solidity programming i have some problem with executing my Contract. My Contract looks like this: # Solidity source code contract_source_code = ''' pragma solidity ^0.4.1; contract ...
0
votes
2answers
20 views

Optimization Exception Remix Editor

I am trying to compile my solidity code in remix editor. I keep getting this error "Optimization exception during compilation". I was using solidity version 0.5.2 till day before yesterday. Now, It is ...
0
votes
0answers
24 views

My smart contract doesn't accept ERC20

NOTICE: The below implementation works. It assumes that the calling addresse has approved both the spender and the contract to carry the transaction. Because they were not approved it was not working. ...
1
vote
0answers
22 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 ...
3
votes
3answers
36 views

Function that returns address if is passed or msg.sender

I'm implementing an ERC721 contract and I want to execute the following logic. This is what I want: If the user pass to a method an address, return that address, if not, return the user's address. I ...
1
vote
1answer
210 views

How does delegatecall work from Solidity 0.5.0 onwards?

I am trying, for learning purposes only, to make a mutable smart contract, but I couldn't find anything useful on stackexchange because everything I found was using pragma solidity ^0.4.x; So, I have ...
0
votes
1answer
23 views

Unable to transfer from a contract to another contract

I was trying to learn how smart contract interaction by implementing a bank contract and a client contract. The end user create a Client contract. Then, he use the Client contract to deposit or ...
2
votes
1answer
473 views

TypeError: Invalid type for argument in function call. Invalid implicit conversion from contract to address requested

I am unable to use the 'this' Keyword in below code. function buyTokens(uint256 _numberOfTokens) public payable { require(msg.value == multiply(_numberOfTokens, tokenPrice)); require(...
1
vote
1answer
165 views

Returning Struct Array in solidity

contract TripHistory { struct Trip { string lat; string lon; } mapping(string => Trip[]) trips; function getTrip(string _trip_id) public view ...
2
votes
2answers
147 views

Getting ParserError: Expected ',' but got 'payable' and also one important security issue with contract

I have write a small smart contract for lottery system. however there is problem. please see below full code. pragma solidity >=0.4.22 <0.6.0; contract Lottery{ address[] public players; //...
1
vote
1answer
28 views

Need to use function modifiers however little confuse when implement and how

Hi I need help for writing below auction code. I want to use modifier however there is some changes in solidity which make me confuse. I have mentioned below where I need changes within "//" pragma ...
2
votes
1answer
40 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() { ...
1
vote
1answer
29 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
110 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
1
vote
1answer
20 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
71 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
59 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; // ...
3
votes
0answers
80 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
39 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
76 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
46 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
1answer
70 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
1answer
128 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
209 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
52 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
38 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
26 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
354 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
104 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
134 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
1k 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
90 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)...