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
1 answer
30 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
26 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
22 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
36 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
31 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
84 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
25 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
81 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
250 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
21 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
44 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
0 votes
1 answer
33 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
36 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
75 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
37 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
32 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
65 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
29 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
32 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
35 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
68 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
42 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
11 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
30 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
  • 938
0 votes
1 answer
38 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
79 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
23 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
15 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
37 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
30 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
  • 320
0 votes
1 answer
33 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
31 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
25 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
30 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
1 answer
74 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
73 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
  • 938
1 vote
1 answer
80 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
51 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
20 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
  • 320
0 votes
1 answer
15 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
23 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
3 4
5
6 7
358