Skip to main content
Share Your Experience: Take the 2024 Developer Survey

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
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
18 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
558 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
24 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
23 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
42 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
30 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
25 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
33 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
0 votes
1 answer
24 views

How to abi.encodeWithSignature the function which contains structure as the parameter in solidity?

I want to call Uniswap's collect function which is in NonFungiblePositionManager contract using delegatecall. But the collect function takes the structure as the parameter. Here is the collect ...
Aviroxi's user avatar
0 votes
1 answer
53 views

ERC721 safeTransferFrom reverts with no message

I'm trying to build a NFT marketplace to learn solidty but i don't understand why my code doesn't work. Here's the relevant parts: // SPDX-License-Identifier: MIT pragma solidity >=0.8.0 <0....
xx_VxR_xx's user avatar
0 votes
1 answer
30 views

Not able to Change version of Solidity Compiler from 0.7.3 to 0.8.25 VS Code

I am getting following error while Compiling my Solidity Program. Compiling using solidity from node_modules, solidity version: 0.7.3+commit.9bfce1f6.Emscripten.clang c:/Users/ADMIN/aave-flash-loan-...
Udayarajan gauthaman's user avatar
0 votes
0 answers
9 views

Searching for proof-readers: "The Aftermath of the Ethereum Merge"

Dear Ethereum enthusiast, I am currently a Business Engineering student at Ghent University in Belgium. As part of my degree requirements, I am conducting research on the Ethereum Merge for my master’...
Simon Van Erdeghem's user avatar
1 vote
1 answer
27 views

Storage ops / gas spent

Is it possible to know the amount of storage operations (or gas spent) that are between, let's say 4 functions, or a full contract? Is foundry capable of this? Thanks!
dNyrM's user avatar
  • 918
0 votes
1 answer
30 views

Solidity Debug: Require statement reverts with no error when met, but prints error when not met

Apologies if the title is a little confusing. I'm new to programming in Solidity, and I think there's just some fundamental misunderstanding I'm having on this code, and I'm unable to fix it until I ...
Opsec Optimum's user avatar
0 votes
0 answers
5 views

Member "transactionCount" not found or not visible after argument-dependent lookup in type(contract TransactionsContract)

I am getting the error: Line: 49 in TransactionsContract.sol Member "transactionCount" not found or not visible after argument-dependent lookup in type(contract TransactionsContract). even ...
Aditya Khare's user avatar
1 vote
1 answer
43 views

Compute CREATE2 pool address in python for a AMM dex contract based on Uniswap v2

I am trying to create a function in python that can generate the pool address from the address of the tokens. The relevant portion of the solidity contracts is below: contract SyncSwapClassicPool is ...
Cristian's user avatar
  • 113
0 votes
0 answers
11 views

How to solve constructor params missing issue?

This is my constructor code for the trading receiver constructor(address _staking, address _trading, address _lzEndpoint) NonblockingLzApp(_lzEndpoint) { liquidityI = ...
Vinit_2311's user avatar
0 votes
0 answers
11 views

Public mint but merkle proof exists

I want to programmatically mint this Base Mainnet NFT: NFT Base Scan code The mint is open to everyone, but when I decode my transaction: TX Link, I can see that there still exits merkle proof that is ...
duyanhhz's user avatar
1 vote
2 answers
33 views

Array of Structs problem and how to test in Remix - Copying of type struct ArrayTest.swapDataStruct memory[] memory to storage not yet supported

Getting this error: Copying of type struct ArrayTest.swapDataStruct memory[] memory to storage not yet supported when I try to assign a parameter to the function which is an array of structs to an ...
Ian Forsyth 's user avatar
1 vote
2 answers
29 views

Assigning the owner variable outside of constructor or function

How is assigning a variable outside of a constructor or a function legit? contract A { address public immutable OWNER = msg.sender; }
Ougi's user avatar
  • 25
0 votes
1 answer
24 views

How to Implement a Minimum Funding Requirement in a Solidity Smart Contract?

I'm currently developing a Solidity smart contract named FundMe, where users can contribute funds in Ether (ETH). I'm aiming to enforce a minimum funding requirement of $50 USD equivalent. However, I'...
Kuldeep Sonara's user avatar
1 vote
1 answer
21 views

Meaning of msg.sender in constructor

What is the meaning of a msg.sender in a constructor? Is it strictly the owner of a contract or any EOA account calling the contract?
Jayman's user avatar
  • 13
0 votes
0 answers
22 views

Ethernaut level 3 CoinFlip consecutiveWins keep resetting

I am currently running Foundry on VS code on the Sepolia test net and I am on level 3 of Ethernaut's CoinFlip challenge. I already have a working exploit and I am trying to deploy it 10 times. I am ...
0xLasadie's user avatar
0 votes
1 answer
21 views

Is It Possible to Generate a Folder Within Pinata Using JavaScript?

I'm interested in creating a JavaScript script that can automatically generate a folder on Pinata. Is such functionality available? My aim is to streamline the organization of JSON file uploads within ...
Awais Ahmad's user avatar
0 votes
0 answers
16 views

Call Swap from Uniswap V3 pool contract instead of through router

I am trying to call swap method from UniswapV3Pool contract, Kindly guide me step by step to call this method. ETCSwap (Ethereum Classic DEX) is using this approach, they are directly interact with ...
Syed Mokarram's user avatar
0 votes
0 answers
12 views

Start Native address took my Ethereum instead of my Remix bot [duplicate]

After watching a youtube video on a certain ethereum bot I followed the instructions and somehow found that the money was sent to some start native address and wasn't being used by my bot. I was ...
Graham Losken's user avatar
0 votes
0 answers
45 views

Solc too slow compiling

The solc compiler that I'm using (0.8.21) is taking too much time to compile. It's compiling 20 files for a foundry test campaign in ~90 seconds when it should be milliseconds. Any ideas on what I ...
dNyrM's user avatar
  • 918
1 vote
1 answer
51 views

Chainlink CCIP publishing message (encoded function call) to bring USDC from another chain is getting reverted with "Ready for manual execution" error

The encoded function call corresponding to bringUsdcFromAnotherChain when called using publishMessageToBringUsdcFromAnotherChain is getting reverted with "Ready for manual execution" error ...
SYED ASAD KAZMI's user avatar
0 votes
2 answers
42 views

Whitelist Addresses in Solidity Contract

I'm trying to whitelist a single *address to be able to interact with this smart contract: pragma solidity >=0.4.22 <0.7.0; contract VisitorTracking{ struct Location{ string ...
howtomqttblockchain's user avatar
1 vote
1 answer
16 views

How does calling parent functions using "super" work?

When I call the function fun inside the contract D, I expect the Logs to be "D.foo" -> "C.foo" -> "A.foo" -> "B.foo" -> "A.foo". However, ...
Ougi's user avatar
  • 25
0 votes
1 answer
11 views

`safeTransferFrom` fails although the contract has enough allowance

I'm creating a contract that calls to another contract to perform a swap. Here is the code for the function that does the work: function swap( IERC20 baseToken, IERC20 quoteToken, ...
Margaret Nguyen's user avatar
1 vote
1 answer
21 views

Can't catch Web3.js' contract error when calling a method and cancelling the transaction

I have a very simple React app that calls a Solidity smart contract's method using Web3.js (4.3.2) with some data coming from a form. I'm trying to catch errors while calling the contract method or ...
Danziger's user avatar
  • 131
1 vote
1 answer
22 views

Modifer To Dynamically Forward Parameters with message sender

I want to create a modifier to dynamically forward parameters to a validator lets say I have a contract contract Foo { address validatorAddress; modifier validate() { assembly { ...
RitzyDevUk's user avatar
1 vote
1 answer
23 views

How to manipulate the first few digits of a Smart Contract?

I saw some devs that can pick the few digits of their choice for their smart contract, like 0xd0d0, and I saw that some even do more than 4 digits (like 5-6 digits after 0x). Does anyone know how to ...
Andrew Manggala's user avatar
0 votes
0 answers
19 views

Is this token a scam? (ABYS)

I was recently browsing the list of new pools on arbitrum and came across this coin: https://arbiscan.io/address/0xd7d39c9fa965b8b2458f2f6100f78e5ad1b318fe Without looking too much into it, I saw a ...
ChewyCorndog's user avatar
1 vote
1 answer
31 views

Deploying Contracts with Multi-Sig Wallet via Safe-Global/Safe App Wallet & Hardhat: Need Guidance

I’m looking for assistance with deploying a contract using either safe-global or the Safe App wallet. My goal is to initiate the deployment with a multi-sig wallet via Hardhat scripts. Can anyone ...
SBansal's user avatar
  • 11
1 vote
1 answer
18 views

Ownable: Inheritance vs. Modifier for Gas Efficiency

When implementing access control in Solidity contracts, OpenZeppelin's Ownable library offers a convenient solution. However, a question arises regarding gas optimization: is it more gas-efficient to ...
Awais Ahmad's user avatar
0 votes
1 answer
29 views

Getting execution reverted: ERC20: transfer amount exceeds allowance code: UNPREDICTABLE_GAS_LIMIT method

Getting this error when attempting to call an external swap function in a contract I created on the Sepolia Test Network from Hardhat TypeScript. reason: 'execution reverted: ERC20: transfer amount ...
Ian Forsyth 's user avatar
0 votes
3 answers
35 views

How do I know what method is called when swap to my ecr20 token?

I am reading ECR20 code: https://docs.openzeppelin.com/contracts/2.x/api/token/erc20 and understand how it works. What I don't know is that what the method is called when swap other tokens to my ECR20 ...
Joey Yi Zhao's user avatar
0 votes
0 answers
27 views

Can't add liquidity to my token

I created a token and now I need to add liquidity to it. Here is a code of my contract: // SPDX-License-Identifier: MIT pragma solidity 0.8.20; abstract contract Context { function _msgSender() ...
Regular User's user avatar
0 votes
1 answer
17 views

Bulk transaction on Base chain

After adding liquidity, I frequently see wallets making bulk transactions on the base chain. How can I snipe tokens early and cheaply like them? CA: 0x1234567517769aCd8519BA85184EdbBaC6062971 Tx: ...
Văn Châu Cao's user avatar
1 vote
1 answer
34 views

Bridging On-chain Data with LLM Models: Retrieving Token Information (Solidity + GPT)

I'm developing a Solidity token and exploring ways to leverage Large Language Models (LLMs) like GPT to answer user queries about the token's data directly within the application. Ideally, I'd like ...
Awais Ahmad's user avatar
0 votes
0 answers
14 views

Uncaught ReferenceError: handleRegistration is not defined at HTMLButtonElement.onclick

I have created and deployed a smart contract for IP management using truffle. I have created a frontend to interact with this deployed contract. <head> <meta charset="UTF-8"> ...
Yash R. Khandelwal's user avatar