Skip to main content
OverflowAI is here! AI power for your Stack Overflow for Teams knowledge community. Learn more

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
1 answer
14 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
12 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
0 votes
0 answers
16 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](https://stackoverflow.com/questions/78492234/...
Nailu's user avatar
  • 1
0 votes
1 answer
20 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
10 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
  • 908
0 votes
1 answer
20 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
0 votes
0 answers
21 views

How come a memecoin like `PEPE` become popular with a very simple source code [closed]

I am reading some memecoin smart contract source code from etherscan. One of them is PEPE as an example, its source code is very simple, just a little extension from ERC20, below is the source code I ...
Joey Yi Zhao's user avatar
1 vote
1 answer
18 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
  • 11
0 votes
2 answers
23 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
0 votes
0 answers
9 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
  • 67
0 votes
2 answers
18 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
6 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
28 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
22 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
0 answers
16 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
7 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
8 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
9 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
1 answer
12 views

Contract verify

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
22 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
  • 13
0 votes
0 answers
18 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
18 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
  • 121
0 votes
0 answers
6 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
21 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
17 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
19 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
17 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
27 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
26 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
38 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
15 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
23 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
12 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
10 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
75 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
12 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
7 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
16 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
1 vote
2 answers
362 views

How to get SEPOLIA TEST ETHER from TESTNET FAUCET without ETH balance in METAMASK account

I tried to get SEPOLIA TEST ETHER from various TESTNET FAUCETS. But all of them require minimum ETH balance in my METAMASK account. I dont have any ETH balance in METAMASK. I tried. https://www....
Udayarajan gauthaman's user avatar
0 votes
1 answer
29 views

How to send a message from one contract to another using an interface in Solidity?

Context: I am developing a smart contract system using Solidity that involves two contracts: HashedTimeLockEther (Main contract) Messenger (Interface contract) Objective: I want the ...
Nerses Asaturyan's user avatar
0 votes
2 answers
28 views

Risk in using Singleton Call forwarding

I have a contract which manages assets. Users can add transfer ownership of contracts to the contract Users should be able to call their own contracts without risking other users having access. I've ...
RitzyDevUk's user avatar
0 votes
2 answers
23 views

Unit test error: "AccessManagedUnauthorized" when minting ERC-20 token in a DAO project

I'm relatively new to Solidity and currently working on building a DAO using the OpenZeppelin contract wizard. I've generated ERC-20 token and governor contracts using the wizard to kickstart my ...
Hessamedean Aghajanlou's user avatar
0 votes
1 answer
23 views

Question about ERC20

struct ERC20Payment { address token; uint256 amount; } I am curious why there is a loop for payout, which is declared as ERC20Payment[] calldata. I understand there are different tokens, and ...
Wonjae Choi's user avatar
0 votes
1 answer
21 views

Why there are two similar functions in the contract?

This image comes from the immunefi github splitter.sol. I am stuyding how to write down the compensation logic for decentralized bug bounty. It seems like those two functions are similar and ...
Wonjae Choi's user avatar
0 votes
2 answers
38 views

"message": "Error: Transaction reverted: function returned an unexpected amount of data", ""message": "Error: Transaction reverted: funct

function createTransaction( uint256 _merchantId, uint256 _tokenAmount, address _tokenAddress ) public onlyActiveMerchants(_merchantId) { IERC20 token = IERC20(...
Anwar's user avatar
  • 51
0 votes
1 answer
29 views

Storage variables or event log

Why use local variables of type storage to store values in a contract if you can emit events and later from the front-end search and retrieve those values? If we do not want to operate with the ...
UnexpectedCharacter's user avatar
0 votes
1 answer
24 views

How do I get a reverted transaction id from an AAVE flashloan request?

How do i get a reverted transaction receipt id from an AAVE flashloan request on the mainnet? The transaction fails and rollsback, but I don't see any tx receipt output for the failed transaction to ...
Ian Forsyth 's user avatar
0 votes
1 answer
31 views

Delegatecall failing 'could not coalesce error'

I'm trying to set a message to my Contract setmsg through a proxy contract using delegatecall.Using hardhat. getting this error: error: { code: -32603, message: "Error: VM Exception ...
Loputocharlio's user avatar
0 votes
1 answer
25 views

Function's reverted when trying to be a middleware to receive exploited fund, return to exploited protocol and send bounty to exploiter

I'm creating a smart contract where exploiter send exploited funds to exploited protocol and automatically get a portion back as the bounty. Here's the smart contract: // SPDX-License-Identifier: SEE ...
dtnwen's user avatar
  • 33
0 votes
1 answer
23 views

Emitting Debug Messages on an Arbitrum Contract during an AAVE Flashloan Call

I'm doing a flash loan request and trying to emit some debug information using events out of the function, but I haven't seen those messages emitted on the arbitrum block explorer or been able to ...
Ian Forsyth 's user avatar

1
2 3 4 5
356