Skip to main content

Questions tagged [solidity]

Solidity is a contract-oriented, high-level language whose syntax is similar to that of JavaScript and it is designed for writing smart contracts in Ethereum to run on the EVM. Solidity is statically typed, supports inheritance, libraries and complex user-defined types among other features.

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

How to implement a reentrancy attack in the English Auction in Solidity?

I implemented a solidity code for an English Auction where different accounts can bid during the specific period of time to win the nft. // SPDX-License-Identifier: MIT pragma solidity ^0.8.25; ...
Daniil Kuntsevych's user avatar
0 votes
1 answer
26 views

Trying to deposit ETH to my contract with Chainlink Functions. Getting gas estimation errors

We were not able to estimate gas. There might be an error in the contract and this transaction may fail Keep getting this error when I am trying to deposit to my contract that is using Chainlink ...
eik's user avatar
  • 3
0 votes
0 answers
24 views

Problem with connecting smart contract function to frontend/metamask

As an exercise to learn Solidity and Nextjs, I started developing a presale smartcontract. It has gotten rather large but I am proud of how far I have come in two months. The contract mints a token, ...
dragoon'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
26 views

TypeError: Cannot read properties of undefined (reading 'getSigner')

get this mistake by running the following: const signer = hardhat.provider.getSigner(); what could be the problem?
אליה שלמה's user avatar
1 vote
0 answers
9 views

Catch internal revert

Is it possible to catch a revert in like an internal decoding? For example: function mint( bytes memory data_, address owner_ ) returns(uint) { ... (AmountsIn memory amts, ...
dNyrM's user avatar
  • 928
0 votes
0 answers
20 views

2d arrays in etherscan

How to Pass 2D Arrays in Etherscan Contract Interaction? I am encountering difficulties when trying to pass 2D arrays to a smart contract through Etherscan's interface. While the function executes as ...
Nerses Asaturyan's user avatar
0 votes
1 answer
20 views

Issue with msg.sender. Calling contract B from contract A

There is currently a published contract (contract A), I must use another(contract B) to call withdraw() from contract A. But the function withdraw() already uses msg.sender as a security check. In ...
Olivia Nicole's user avatar
0 votes
0 answers
7 views

Getting a collection back from ExactInputSingleParams in Uniswap V3, not the swap amount value

I'm using ethers.js and typescript to call a contract's swap function: ExactInputSingleParams in Uniswap V3,and getting a collection returned with many different elements in it, rather than the output ...
Ian Forsyth 's user avatar
0 votes
2 answers
36 views

Can I Recover a Smart Contract Written On Remix

I wrote a smart contract earlier today using Remix. I was away for a few hours, and when I came back my computer was out of battery. I've configured my browser to never save cookies, so even when I go ...
Spaghetti's user avatar
0 votes
1 answer
36 views

Want to redirect to react component based on metamask address

I'm building an Identification management dApp, in which I have to redirect to a different component based on selected MetaMask account address. For example, if I'm an applicant then I will be ...
Shorna's user avatar
  • 17
0 votes
1 answer
94 views

"message":"execution reverted: arithmetic underflow or overflow"

constructor( address[] memory setupAddys, uint256 _totalTokensForSale, uint256 _softCap, uint256[] memory _Participation, uint256[] memory _Times, uint256 _lpPercentage, ...
asnidar as's user avatar
0 votes
0 answers
27 views

Need help with smart contract audit (private key guessing game)

The game is that you need to brute force the private key. The one who first finds the private key from 0x1a642f0E3c3aF545E7AcBD38b07251B3990914F1 receives all the ether. As for the math of ecrecover, ...
xayafek555's user avatar
0 votes
1 answer
107 views

I can't deploy my Token because of EVM version (?)

This is my code, I tried every evm version paris,berlin,istanbul etc. I can't figure out why it doesn't work. Also this is a school project that's why the version is very old we're using an old parent ...
Erdem Arif Akalin's user avatar
0 votes
0 answers
31 views

I have a problem with calling a function from another contract. I don't know why it is not working

I'm trying to solve a CTF challenge and can't seems to call the claim function from the vuln contract. I must use my "EOA" address to solve task to mark it solved, because my "EOA" ...
jose celis's user avatar
1 vote
0 answers
43 views

How to debug <UnrecognizedContract>.<unknown>?

I'm getting errors while trying to mint a new position on Uniswap V3 with a fork networkI've already opened a question on Stack Overflow about that here I'm wondering how can I debug and maybe import ...
Nailu's user avatar
  • 11
0 votes
1 answer
27 views

Why is my _transfer function transfering all my tokens to the deadWallet?

I wrote this simple contract that is designed to burn (send to deadAddress) all transfers that in which the sender of the transaction is not the LP address. I provide liqudity on uniswap and then set ...
Stavros Cotsoradis's user avatar
0 votes
0 answers
20 views

Mock unit tests

For a "professional" project that's created to look for funding, are mocks from unit tests recommended to be the old fashion way by creating each mock from scratch or is it ok with just ...
dNyrM's user avatar
  • 928
0 votes
1 answer
34 views

Error while calling "requestRandomWords" function while implementing Chainlink VRF mock contract on local Remix environment

I've followed this tutorial, but when I tried to call function RandomNumberConsumerV2.requestRandomWords, I got the following error: [vm]from: 0x5B3...eddC4to: RandomNumberConsumerV2....
rebwar's user avatar
  • 3
1 vote
1 answer
33 views

Foundry error on CLI command

forge create --rpc-url $QUICKNODE_RPC_URL --private-key $PRIVATE_KEY --etherscan-api-key $ETHERSCAN_API_KEY --verify src/Token.sol:Token [⠒] Compiling... No files changed, compilation skipped The ...
Flegi's user avatar
  • 13
0 votes
2 answers
33 views

I can't deploy my coin on Remix IDE

I'm trying to write my first smart contract but when I try to deploy it I get this: This contract may be abstract, it may not implement an abstract parent's methods completely or it may not invoke an ...
Erdem Arif Akalin's user avatar
1 vote
1 answer
29 views

Slither: .. uses dangerous strict equality

Context After having written the following rough draft for an eject button in some contract: function triggerReturnAll() public override onlyAfterDelayAndUnderTarget { require(msg.sender == ...
a.t.'s user avatar
  • 79
0 votes
2 answers
21 views

Gas estimation errored with the following message (see below) - Solidity Study

I'm studying solidity development with FreeCodeCamp.org. Within the course there is a contract called fund.sol where you can finance a contract with donations in dollars, the following question ...
user2238658's user avatar
0 votes
1 answer
11 views

How do you implement diamond proxy fallback function?

According to the official EIP2535 in the fallback section: It is missing the position slot: // Find facet for function that is called and execute the // function if a facet is found and return any ...
anonauditor's user avatar
0 votes
1 answer
36 views

An ERC1155 token metadata is not visible in polygonscan and etherscan

I have deployed a basic ERC1155 importing the Openzeppelin libraries. Here is my smart contract. // SPDX-License-Identifier: MIT // Compatible with OpenZeppelin Contracts ^5.0.0 pragma solidity ^0.8....
Shiv Sharma's user avatar
0 votes
2 answers
49 views

JsonRpcProvider not Found in ethers.js

I'm building a JavaScript application where I'm trying to interact with the Ethereum blockchain using ethers.js. However, I'm encountering an error stating that JsonRpcProvider is not found. This ...
Kuldeep Sonara's user avatar
1 vote
1 answer
30 views

Foundry: Member "getBlockTimestamp" not found

I'm trying to use a method from foundry which is located here in the documentation When I try to call it like so: uint256 timestamp = vm.getBlockTimestamp(); I'm getting an error: Member "...
RitzyDevUk's user avatar
0 votes
1 answer
10 views

What happens to opcodes during fork tests in foundry?

When you fork a chain in foundry, does it also copy the chain opcodes and the associated gas?
smol-ninja's user avatar
0 votes
1 answer
30 views

Error in Fork Testing

I ran the test: forge test --fork-url $SEPOLIA_RPC_URL and this error was returned: error: a value is required for '--fork-url <URL>' but none was supplied. // SPDX-License-Identifier: MIT /...
Kwesili Okafor's user avatar
0 votes
0 answers
17 views

Contract Execution always fails while calling the flash loan with 1Inch API

I am getting the data from the 1inch api and I am using this contract for executing the flash loan. However, almost all the transactions are failed with the message, "Transaction Reverted ...
Rudransh Sharma's user avatar
0 votes
2 answers
27 views

Contract verify [duplicate]

I get such error of compilation in Optimism Sepolia testnet network.The contract succesfully compiles using hardhat with needed configuration.What should I do to get verified the contract ?
Nerses Asaturyan's user avatar
0 votes
1 answer
31 views

Can't get the stored data from blockchain

I am builing a simple crud dapp . Where I am adding user name ,email , gender ,functionality to blockchain . This dapp has 4 function Create ,update ,delete ,getting Userlist . All the three functions ...
Shorna's user avatar
  • 17
0 votes
0 answers
29 views

Uniswap OLD revert after swap

I am initializing new pool, and have a contract that allows doing swap on it utilizing TWAP Oracle. I have tested the TWAP and in tests it needed 1 second delay to return correct quotes, until doing a ...
Jan Kwiatkowski's user avatar
0 votes
1 answer
21 views

Is there Uniswap V2/V3 function to get initial token supply amount in pool?

I need to get initial token supply when liquidity pool was created by querying Ethereum node (RPC) or Uniswap contract and not Mint() function, is it possible to do (python)? To get reserves on any ...
sirjay's user avatar
  • 93
0 votes
0 answers
10 views

not able to view File Contents in Remix IDE

REMIX IDE. When I click on a File in File Explorer contents are not visible on the right hand side. attached screencapture.( infact file is not highlighted also.) thanks Uday
Udayarajan gauthaman's user avatar
0 votes
1 answer
25 views

Best Practices for Gas Optimization in Ethereum Smart Contracts

Ethereum community! I'm currently working on developing a smart contract for a decentralized application (dApp) on the Ethereum blockchain. I'm concerned about optimizing gas usage to enhance ...
Ian Park's user avatar
0 votes
0 answers
28 views

Get token using uniswap V3

I deployed 3 tokens and created a liquidity pool with tokens 1 & 2 then tokens 2 & 3. Now i want to get the token 3 in token 1 using UniswapV3. // SPDX-License-Identifier: MIT // Compatible ...
user135270's user avatar
0 votes
1 answer
24 views

Testnet USDC from https://staging.aave.com/faucet/ not showing on Metamask

I am getting Testnet USDC from https://staging.aave.com/faucet/ not showing on Metamask. I approved the transaction in Metamask. It is showing on Aave page at USDC Testnet Faucet but not showing on ...
Udayarajan gauthaman's user avatar
0 votes
1 answer
21 views

How to enable multi-payment in the NFT marketplace like ETH, USDT, MATIC, DAI, etc?

Hope you are doing great. I'm trying to build a NFT marketplace with multi-payments. When users buy a NFT, they must be allowed to pay with any of the payments such as ETH, USDT, MATIC, DAI... How to ...
Vara Prasad's user avatar
1 vote
1 answer
35 views

Safe Wallet: "Solidity Compiler Bugs"

Good day I have created a safe wallet. Out of curiosity I checked the created address on Etherscan. Under "contract" there is a warning on the right that says "Solidity Compiler Bugs&...
Jay's user avatar
  • 11
0 votes
1 answer
29 views

Check if a function selector exists in a contract

Is it possible in Solidity to check if a function selector exists in an external contract without attempting to invoke said function?
Ahmed Ihsan Tawfeeq's user avatar
0 votes
2 answers
66 views

How to use `MCOPY`?

I'm a student who's learning smart contract develop. I want to write some assembly codes to solve this problem. function convert() public pure returns (bytes memory) { ...
Marco Chang's user avatar
0 votes
1 answer
21 views

Abi Encode with Signature - String memory as parameter to function

I'm trying to do abi.encodeWithSignature( "mint(address, string **memory**)", receiverAddress, tokenURI ) The function definition ...
MAYANK CHHIPA's user avatar
2 votes
2 answers
27 views

Renouncing a contract that contains a chainlink upkeep

I am creating a contract that I want to be fully renounced, but there is also a function that needs to be called once a year in the contract. I created a chainlink upkeep to call it. The upkeep adress ...
Stavros Cotsoradis's user avatar
0 votes
1 answer
51 views

Foundry: script failed: cannot `prank` for a broadcasted transaction; pass the desired `tx.origin` into the `broadcast` cheatcode call

This is my Foundry Script: // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "forge-std/Script.sol"; import {SendaTokens} from "../SendaTokens.sol"; contract ...
Nasser el bacha's user avatar
0 votes
0 answers
11 views

Help with addLiquidtyEth keeps returning either transfer_from Failed or OVERFLOw

Im trying to add all tokens to liquidity. It doesnt allow the amount of tokens desired to be more then the total supply so im not sure why it keeps returning 'execution reverted: pancake: OVERFLOW' Im ...
blockchainhelpneeded's user avatar
0 votes
1 answer
232 views

Facing the "factory runner does not support sending transactions" error while executing deploy script of Hardhat

When I run: npx hardhat run --network sepolia scripts/deployFlashLoan.js I am getting this error: factory runner does not support sending transactions (operation="sendTransaction", code=...
Udayarajan gauthaman's user avatar
0 votes
0 answers
20 views

Smart Contract version update doubts

It is possible to update smart contracts using unstructured storage. But I have some doubts. Would it keep the same address as the first SC? Would it keep the persistence of the log information, or ...
UnexpectedCharacter's user avatar
1 vote
0 answers
8 views

NFTs made from other NFTs

I am working my first ethereum dapp, a supply chain app which tracks the movement of meat products from farm to fork. I have decided to digitise these as ERC721 NFTs, starting with the animal at the ...
user134392's user avatar
1 vote
1 answer
29 views

How do forks in Foundry work?

What you fork a chain in foundry, what chain data does it copy? Does it copy OPCODEs and their gas as well?
smol-ninja's user avatar