Questions tagged [contract-debugging]

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

Filter by
Sorted by
Tagged with
2
votes
1answer
12 views

Don't know how to get money out of smart wallet

Three years ago I bought some Ethereum. Little as I knew I put some of it in a smart contract. The smart contract says it has 0.21 ether. https://etherscan.io/address/...
1
vote
0answers
10 views

Where to outsource smart contract developers, and how to manage them as start-up's CEO?

If someone has an idea for a DApp, but needs to hire programming muscle, where online can reliable and innovative smart contract developers be found for hire and outsourcing? and what etiquette and ...
0
votes
0answers
52 views

ALERT: Transaction Error. Exception thrown in contract code. Metamask while interacting with contract

When I try to interact with my contract (.vue, Web3) via Metamask browser extension, I get the warning "ALERT: Transaction Error. Exception thrown in contract code." when I attempt to buy. ...
0
votes
1answer
13 views

declaration error identifier not found or not unique

pragma solidity 0.7.4; contract MyToken { address public minter; mapping (address => uint) public balances; constructor(){ minter = msg.sender; } function ...
0
votes
0answers
19 views

A smart contract that compiles and doesn't have errors, is not deployed and revert all the process

I have a central smart contract that inherits from other contracts and create two entities that are the entities of the contract that are going to sign it. This "central" contract is named &...
0
votes
0answers
13 views

Need help getting ETH back after BSC transfer [duplicate]

I have tried to transfer ETH from Binance to Trust Wallet using BSC. The funds went to C.R.E.A.M. Finance, which is accessible through Trust Wallet's DApp. It seems like there is no option to withdraw ...
0
votes
0answers
6 views

In the context of Ethereum contract creation, what does “cyclic creation dependencies are impossible” mean?

I'm reading the official solidity docs and came upon this passage on Ethereum contract creation: "cyclic creation dependencies are impossible", followed by the example code below (and also ...
0
votes
0answers
10 views

How to test contract interactions without pay fee

I have my contract which interacts with two different exchanges, can i test this interaction without pay fee? Before Deploy to the main net? I know it has Ropsten but it wouldn't work i think, i need ...
0
votes
1answer
15 views

Getting contract address

I saw an example about this, while was searching it on the internet. I want to deploy a new contract which is ProjectContract. However, I could not get contract address as below. I think this is for ...
0
votes
1answer
42 views

Cant verify Smart Contract deployed with Remix

// File: @openzeppelin/contracts/token/ERC20/IERC20.sol // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface ...
0
votes
0answers
50 views

Scan for new Contract/Token

I am trying to find a way to use the JSON-RPC calls to scan for new tokens on the BEP-20 Binance chain. I cannot find any documentation or information regarding this.
0
votes
1answer
311 views

“execution reverted” Error when deploying Safemoon fork on Rinkeby

I keep getting this error message when trying to deploy a Safemoon fork. There's no other information provided. Code is here https://bscscan.com/address/0x8076c74c5e3f5852037f31ff0093eeb8c8add8d3#code ...
1
vote
1answer
22 views

how are the exploited smart contracts fixed

We have seen many defi hacks taking place one thing i don't understand is how the bug in contract fixed given that smart contracts are immutable. Is it somehow related to delegate call or interfaces....
1
vote
0answers
8 views

Is there any EVM debugger with a flexible UI layout available as of 2021?

Remix debugger seems to be pretty mature. But, its web-based interface makes it impossible to shuffle the block around. For example, I want to move the "Stack" section to the right sidebar ...
0
votes
1answer
17 views

Problem with smart contract's constructor instantiating another smart contract

I have the following two smart contracts in the same ".sol" file: Credentials and Proposals. Every Proposals smart contract should refer to a single Credentials smart contract, in order to ...
1
vote
1answer
20 views

setting value using address.call() doesn't works

I am trying to run a setter function (testCallBar) in Caller contract which should run setVal() of Receiver contract using call method. But it does not works. testCallFoo() works as expected but ...
1
vote
1answer
37 views

Solidity: ParserError: Expected pragma, import directive or contract/interface/library definition. function

I am using Truffle together with Ganache and I can't get this code to run: pragma solidity >=0.4.21<0.6.0; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@...
0
votes
1answer
18 views

My Ethereum smart contract is always returning an empty array when using web3 with metamask

import Web3 from 'web3'; window.ethereum.enable(); const web3 = new Web3(window.ethereum); const address = "0x977b5A39B6E95A7688570BF1b77e8FAb150791af"; const abi = [ { inputs: [], ...
0
votes
1answer
31 views

How to merge 2 transactions in one? [duplicate]

First of all, I have already searched on Google, and I didn't find a clear answer. What I would like to do : For example, I would like to make one swap on uniswap, and the second to sushiswap, in the ...
0
votes
1answer
18 views

bytes32 is not implicitly convertible

I am getting some errors related to bytes32. I tried to use the casting but it is not solving the proble. My code is: pragma solidity ^0.5.6.0; contract peInKSub{ bytes32 [] m_pendingIndex ;...
1
vote
3answers
296 views

Incorrect Uniswap Liquidity Calculations. What could be wrong?

Looking though a uniswap address: https://info.uniswap.org/account/0xd62317c76E626D53C900088Fb07539b829B564B2 This address shows that it added $30k+ worth of liquidity, and none of it is removed. Why ...
0
votes
0answers
21 views

Truffle test doesn't seem to finish before “succeeding”, and doesn't wait for transactionHash of a sent tx!

quick problem I've been slamming my head against since last night, My truffle (v5.2.3) test file performs two (2) tests, that serially call() then actually send a transaction to make persistent ...
0
votes
1answer
35 views

Truffle test failing with “Error: Returned error: VM Exception while processing transaction: revert” - how can I debug it?

I'm using truffle, the ganache AppImage to run a personal blockchain, and have 2 solidity smart contracts Migrations.sol and PassportManager.sol I'm running a truffle test and getting Error: Returned ...
1
vote
1answer
21 views

Why is the math code causing transactions to fail

Ok so This is my first time working on solidity contracts and I'm at a loss how to debug this code. This code fails: function claimReturns(address claimant) private { uint otherTotals = ...
1
vote
0answers
31 views

Smart contract copying code beyong code length

I've seen a couple smart contracts (eg the contract decompiled in this answer) use this pattern: Code[Code.Length:Code.Length+x] This surprised me because I would expect Code.Length to mark the end of ...
1
vote
1answer
41 views

transfer of ERC721 between EOA to contract

If I have contract A and contract B (which follows erc721 standards), both have implemented the OnERC721Received function, how does the transfer of any tokenId take place atomically? If I have a token ...
0
votes
1answer
30 views

Why this delegatecall attack not working?

I am confused by this simple contract. The main purpose is to bypass the OnlyContract() modifier. Victim contract. pragma solidity 0.7.6; contract Victim { modifier OnlyContract() { ...
0
votes
0answers
96 views

Uniswap fork only fetches 14 times

I've forked uniswap V2 to xDai and deployed its interface & analytics. Interface seems to work well, but when you visit analytics, it never loads. Here's subgraph - https://thegraph.com/explorer/...
0
votes
1answer
27 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
49 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
68 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
25 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
428 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
18 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
37 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
331 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
14 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
8 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
10 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
81 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
65 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
22 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
23 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
38 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
37 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
234 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
25 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
39 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 ...

1
2 3 4 5
11