Skip to main content
The 2024 Developer Survey results are live! See the results

Questions tagged [contract-debugging]

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

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

4 Most Important Questions For Smart Contracts Developers

Hello Smart Contracts Developers Which Blockchain like Etherscan, Bscscan, Polygonscan, Tronscan.... etc that automatically approve new token logo and token value application? Which stable coin ...
Tether Usdt's user avatar
0 votes
2 answers
46 views

stuck ether on smart contract

Is there any way to recover ether that is stuck in a smart contract? my ca. 0x1DA851535C587757d916C72Bdf0581cd2C38ea34
user_error's user avatar
0 votes
0 answers
16 views

Why are taxes not being deducted or received in the FEE_RECIEVER variable in my Solidity smart contract?

I'm working on a Solidity v0.8.20 smart contract with buy/sell tax features. Despite testing on BSC Testnet (PancakeSwap) and Sepolia Testnet (SourceHat), the taxes aren't being deducted or sent to ...
Awais Ahmad's user avatar
0 votes
0 answers
19 views

bought a token that is unsellable, but I can see that on Etherscan that few accounts are selling the same. Is there a way I can sell this token [duplicate]

I bought this token 'Monad' on uniswap. It seems to be all fine but than later realized that this token is unsellable. I can see that the team are able to sell the token, and so did someone else who I ...
Rajiv Chandla's user avatar
0 votes
1 answer
28 views

Function is callable from Thirdweb Dashboard but not from the front end

I can call the function from the Thirdweb Dashboard and I get appropriate outputs but whenever I try calling it from the frontend I get a very weird error Here is the function: function userStakeInfo(...
Mohamed Wael's user avatar
0 votes
1 answer
51 views

"ContractExecutionError: Error happened while trying to execute a function inside a smart contract" after calling it via mint button

Contract Code: // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; import "@openzeppelin/contracts/...
Lucky Rajput's user avatar
0 votes
1 answer
29 views

Very High gas fee in my staking contract

I am trying to implement my staking contract, for some reason calling stake() or claimRewards() costs 2MATIC ~ 4MATIC. I know my code is kind of complex since I loop and use data structures but still ...
Mohamed Wael's user avatar
0 votes
1 answer
58 views

how to verify contracts in contract (created with contract ) polygon

i have a following structure for my contracts : 1 - OpenZeppelin v 4.9 2 - safepool 3 - safepoolfactory i have a single file that this code : pragma solidity ^0.8.0; import "https://github.com/...
Hosein In jast's user avatar
0 votes
1 answer
41 views

Openzeppelin ERC721Enumerable getTokenIdsOfOwner reverts and I don't know why

I am trying to implement a staking contract, I wanted to map all the owned NFTs by a certain address, so came across ERC721Enumerable and getTokenIdsOfOwnerfunction, however whenever I call my ...
Mohamed Wael's user avatar
0 votes
0 answers
22 views

unable to sell token despite seeing other wallets selling

I bought this token on base network and the contract looks perfect to me, but i realize i was unable to sell/swap the token after increasing the slippage to 50%, i can see other wallets selling and i ...
Job Toni's user avatar
0 votes
0 answers
23 views

Is everything okay with this Presale contract?

Could you help me check if this presale contract does what it's supposed to do and if it's safe? I tried to find bugs or flaws but couldn't find anything. The theory is very simple: the user can use ...
Integral's user avatar
  • 115
0 votes
0 answers
10 views

Truffle debugger can't connect to node

I'm trying to debug a contract. I have ganache open forking the Ethereum mainnet that uses in the settings the same host and port as my truffle-config.js (127.0.0.1:7545). I can migrate/deploy and ...
Hiperfly's user avatar
1 vote
1 answer
21 views

LP contract doesn't approve

I created this contract to simulate a liquidity pool and I'm testing it with the Remix IDE. I can say it works fine, except for the function to swap tokens for ether, which is bothering me. The user ...
Integral's user avatar
  • 115
0 votes
0 answers
12 views

Missing Eth after sending to contract - Internal transaction [duplicate]

I saw a YouTube video of how to create a smart contract, after sending 0.2 ETH it was transferred to a different contract through internal transactions. here is the link for the code and contract ...
Saba Purtseladze's user avatar
0 votes
1 answer
32 views

Sent Eth to contract address can I get it back

I sent some Eth to a contract address rather than my wallet. Can someone with some code experience have a look at this contract and let me know if there is a function on here that the Devs could use ...
Fez's user avatar
  • 3
0 votes
0 answers
11 views

What Delegate function does in this contract? Its not sellable but scanner dont recognize it

/** *Submitted for verification at Etherscan.io on 2024-03-26 */ // SPDX-License-Identifier: UNLICENSED /* Website: https://www.mode.network/ Twitter: https://twitter.com/modenetwork ...
Developer's user avatar
0 votes
0 answers
37 views

npx hardhat test "Timeout of 40000ms exceeded" when repaying flash loan

I am trying to follow along with a youtube tutorial that teaches you how to make a basic uniswap flash loan application. I have copied every piece of code, line by line, from the video as instructed. ...
ChewyCorndog's user avatar
1 vote
1 answer
34 views

How to fix? warning (2018) function state mutability can be restricted to view

function withdraw() external onlyOwner { if(block.timestamp < end || totalCollected < goal) { revert CollectNotFinished(); } }
ansoiri98's user avatar
0 votes
0 answers
29 views

Truffle ganache debug not working

I have installed truffle and ganache and the @ganache/console.log library. Furthermore, I have the following contract from an online course which serves as an example to demostrate the debug mode of ...
TheDude's user avatar
  • 111
0 votes
1 answer
29 views

Transfer Value isn't showing up in the contract value [duplicate]

So I'm totally new to ethereum. I'm asking you for help, maybe I don't understand the mechanics of this correctly. I set up a contract und transferred a little eth to it. But the transfer value never ...
trissdissi's user avatar
1 vote
0 answers
19 views

which fork debugger to use?

what tool are you using to debug mainnet contracts. So doing a fork and be able to step into line by line (considering you have the source ofcourse), but doing it on live contract. I tried to use ...
Josip's user avatar
  • 53
0 votes
0 answers
9 views

inspect local vars in fork?

Trying to find a way to inspect local variables during method call when having failed tx. Is there a way to example fork mainnet with hardhat and then to have insight on used local variables when ...
Josip's user avatar
  • 53
0 votes
0 answers
34 views

im building an auto crypto profit generator. i need some help making it work right. (incomplete code attached)

to start with, im already deep into the process of creating this thing, ive already spend $1000 on this contract (dont feel bad for me, thats one paycheck and i needed to learn the deploying and ...
SoullessScythe's user avatar
2 votes
1 answer
317 views

Solidity debugger in VS Code

Is there a good Solidity debugger out there for Foundry that gives you the same UX in VS code as when debugging a node.js app? Like local/state variables inspection, breakpoints, etc?
dNyrM's user avatar
  • 938
0 votes
0 answers
54 views

How to correctly read the storage changes from a contract based on stack values from debug_traceCall

I have an example structLogs from debug_traceCall { "depth": 6, "gas": 46056236, "gasCost": 2900, "op": &...
Billy Adelphia's user avatar
0 votes
0 answers
57 views

Spot the problem in the contract of the unsellable token

I am currently trying to understand how the smart contracts work. I have bought a tiny amount of a token that I suspect to be honeypot and indeed it is unsellable, PancakeSwap gives the error: ...
baronett's user avatar
0 votes
1 answer
32 views

Calling Uniswap Multihop Function returns Error

Deployed on Polygon Mumbai. Code compiles fine on REMIX and is meant to perform multihop swaps on Polygon Mumbai, but it returns error after function is called. Deployed Contract always funded with ...
Samuel Aniss's user avatar
0 votes
0 answers
70 views

What will happened to my WETH TOKEN if the receiver or the network didn't support WETH TOKEN

I send WRAPPED ETH to a wallet/network which is COINS PH WALLET that has supported ETH ADDRESS, i thought WETH and ETH are the same? Now my problem is how can i possible retrieve my TOKEN?
Omar's user avatar
  • 1
0 votes
1 answer
32 views

My fund was stuck at ParaSpace, multi signer A&B initiated the code on@safe, but C said they were doing sth else, can someone help me?

It was a long story, i mistakenly sent 12eth to Para. https://etherscan.io/tx/0x72ef5f105ec1c40f917d92aa48caafe24448d9d8507c303ee9a66cbad2c0e983 but somehow para side set up this https://app.safe....
wonderX's user avatar
0 votes
1 answer
35 views

How do I add my address to a deployed contract public address using a security exploit? (coding challenge)

I'm working on a coding challenge for smart contract security exploits. I need to add my address to public address (browerr) in the contract. Do I need to create another contract that inherits the ...
johnTg's user avatar
  • 1
2 votes
1 answer
362 views

Failed to parse as type `uint256`: a character is not in the range 0-9

I am following Patrick Collins Smart Contract Lottery development and trying to run the deploy script test net ( sepolia ) but I am getting this error Error: Failed to parse as type `uint256`: a ...
Iftikhar uddin's user avatar
1 vote
1 answer
113 views

How to Implement a Proxy Contract to Fix an Existing Investment Smart Contract with Active Investments on BSC?

I'm currently facing a challenging issue with an investment smart contract deployed on the Binance Smart Chain (BSC). The contract already has active investments, but it contains a critical bug that ...
vasik's user avatar
  • 71
1 vote
1 answer
30 views

How to call a function from a separate contract

I have a already deployed contract and it has a withdraw() function. And i want to create another contract that first send some ETH to the target contract and then call the withdraw() to withdraw ...
Arkonomi's user avatar
2 votes
2 answers
848 views

What are the differences of Foundry vm.prank vs vm.broadcast

What are the differences of Foundry vm.prank vs vm.broadcast
anonauditor's user avatar
1 vote
0 answers
39 views

Truffle console: debug not showing me the code line that reverts a transaction

I'm trying to deploy my own swap router on the development network. I've got a transaction hash which reverts. I'm calling truffle console and then, when I press enter I get undefined. I can't reach ...
Radek_pl's user avatar
  • 791
1 vote
3 answers
41 views

If dos a single function solidity, will other functions not work?

I read lots of articles about dos causing a Denial Of Service. Let say that a contract has 2 functions, if called one of them repeatedly, will the other function works? Contract ABC { function one() ...
anonauditor's user avatar
1 vote
0 answers
50 views

failed to deploy smart contract on my private network

I created a private network of POA, and I use clef to seal blocks like this: I have successfully run this chain becaues it can produce blocks and I can create transactions between 2 accounts, and ...
jds250's user avatar
  • 11
0 votes
1 answer
238 views

Help - MEV Contract [duplicate]

I created an deployed a MEV bot via remix.re — after deploying the contract — I noticed the internal transaction sent to an unknown address. Any help on seeing what happened here?? My Contract Address ...
Levi's user avatar
  • 1
0 votes
1 answer
27 views

Issue with DynamicSvgNft Contract: getHighSVG() and getLowSVG() Functions Returning Incorrect Values

Hello Stack Exchange community! I am currently working on a project that involves an NFT contract called DynamicSvgNft. The contract is designed to change the SVG image URI of the NFT based on a ...
Web3Phoenix's user avatar
0 votes
0 answers
72 views

I have tried debugging the code but still i am not able to find the error. Function "getDonators" not found in contract

import React, { useContext, createContext } from "react"; import { useAddress, useContract, useMetamask, useContractWrite, } from "@thirdweb-dev/react"; import { ethers } ...
Indul's user avatar
  • 29
1 vote
0 answers
38 views

How to deploy a contract to the same address in testnet?

My code for deploying a contract import { ethers } from "hardhat"; async function main() { const CF = await ethers.getContractFactory('abc'); const c = await CF.deploy(); await c....
Camila326's user avatar
  • 115
0 votes
1 answer
113 views

Hi all! I have got a problem with verification of the contract on BSCScan ! Can some one explain me the problem please?

ParserError: Source "@openzeppelin/[email protected]/token/ERC20/ERC20.sol" not found: File import callback not supported --> myc:4:1: | 4 | import "@openzeppelin/[email protected]/token/...
John Smith's user avatar
0 votes
2 answers
68 views

Can someone explain why this require does not stop the function?

it might be simple but I am in the process of learning solidity. In remix IDE, debugging a contract function, the function starts with two requires: function transferFrom(address owner, address ...
Christophe Brun's user avatar
1 vote
1 answer
154 views

Trying to use the Debug feature in Hardhat, but facing the following error "Error HH404: File, not found."

I am trying to debug a smart contract using hardhat. I am using the below code. pragma solidity ^0.8.9; import "Hardhat/node_modules/hardhat/console.sol"; contract SmartWallet { ...
Pratik Jussal's user avatar
1 vote
0 answers
194 views

Remix IDE runs every transaction twice in Remix VM - Mainnet fork (and Testnet forks)

I ran some unit tests in Remix IDE using the Remix VM - Merge. It works without any issues. As I needed the ERC-1820 registry contract I switched to Remix VM - Mainnet fork for the unit tests. Some ...
fish filet's user avatar
3 votes
1 answer
17 views

How do I make a blanket statement to be notified if certain wallets mint?

I've been trying to come up with a way to track wallets and be notified when they 'mint'. The way i'm doing it now seems like it will only catch around 50% of all transactions due to the nature of the ...
oyxf's user avatar
  • 41
1 vote
1 answer
3k views

bought a token that is unsellable, but I do not spot the code in the contrat that is responsible

I bought this token, had a good app for trading and a well written medium which didn't seem scammish at all. the token even managed to pass on the normal basic tools for honeypot detection and ...
user119739's user avatar
2 votes
1 answer
40 views

Getting successful and failed txs with the same code

// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; contract Shuffle { constructor() { ranking = [0,1,2,3,4,5,6,7]; currentSeason = SeasonType.Spring; } enum ...
East's user avatar
  • 21
0 votes
1 answer
22 views

the `cancelEvent` function in my contract works fine when no ticket has been purchased but raises an error once a user purchases a ticket

function cancelEvent(uint256 eventId) external returns (bool){ require(eventExists[eventId], "Event does not exist"); require(events[eventId].eventstatus != Status.CLOSED, "Event is ...
Ogolo Prince's user avatar
0 votes
1 answer
58 views

Why am I getting `undefined` when trying to access array elements in Truffle Console?

I am getting an array from my contract, which seems to have the correct number of elements. However, when trying to access the first element using index notation, I am getting undefined: myArray = ...
pooya13's user avatar
  • 103

1
2 3 4 5
15