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
9 views

How to increase gas limit for transactions in Foundry?

Is there a way to do it in the script file itself or through terminal command? Currently making transactions using the command: forge script script/Counter.s.sol:CounterScript --rpc-url $...
Surya M D G's user avatar
0 votes
0 answers
4 views

How to use Access Control in different facets if a Diamond Contract

I am looking to change the design of my contract into diamond proxy. For that i have split up my contract into 3 parts. the issue i am facing is while setting up access control. When i am using OZ ...
Azrael's user avatar
  • 1
0 votes
0 answers
6 views

Does having identical public keys and messages for bn254 verification decrease gas cost?

I want to verify an aggregate bn254 signature. Now lets say that I am aggregating 3 identical signatures which results in a new signature. So now if I give 3 identical public keys and 3 identical ...
Surya M D G's user avatar
0 votes
0 answers
14 views

Why is the struct not updated in my contract?

// SPDX-License-Identifier: MIT pragma solidity ^0.8.18; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are ...
d1mpis's user avatar
  • 1
0 votes
0 answers
27 views

Is it possible to emit generic events using assembly?

I'm trying out a proxy / upgrade pattern where the deployed contract is an ERC-721 but it delegates as much functionality to a "controller" contract as possible. The storage is split between ...
okwme's user avatar
  • 293
0 votes
1 answer
20 views

Is there any multiple private keys for a single address wihin first 2^160 private keys?

There are three different terms: Ethereum private keys are 32 bytes Ethereum public keys are 64 bytes Ethereum addresses are 20 bytes So, it is possible of havng multiple private keys (2^96) for a ...
Asif Iqbal's user avatar
0 votes
0 answers
9 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
1 answer
12 views

Small space appearing before string in remix

Hello I saw that type casting from bytes to string gave the same result whether the bytes are a string encoded or encodePacked. So I am trying some small contract in remix, to see how that works and ...
Aimane Harrak's user avatar
0 votes
2 answers
16 views

Decompiled Smart Contract Code - Language Identification?

I recently decompiled a smart contract using Etherscan and encountered the following code snippets: def _fallback(): // not payable, default function require calldata.size - 4 >= 0 if caller!= ...
adam mr's user avatar
  • 131
0 votes
0 answers
12 views

Request for Goerli/Sepolia Testnet Ether

I'm currently developing a blockchain application for my internship and need some Goerli or Sepolia testnet Ether to deploy and test my smart contracts. Unfortunately, I don’t have any previous ...
anika's user avatar
  • 1
0 votes
0 answers
10 views

Fraudulent contract or valid?

What do you think about this code and BOT recommendation? I am attaching the video. In the description of the video, the code. I suspect it's a scam. In lines 109 and 113 of the code, there is a ...
Attila Koch's user avatar
0 votes
0 answers
14 views

How to Ensure Custom Tax is Applied on Token Swaps in Solidity Smart Contract?

I'm developing a smart contract for a token (FMYNT) using Solidity on the Binance Smart Chain testnet, integrated with PancakeSwap testnet. I've implemented a custom 5% tax feature for buy and sell ...
Awais Ahmad's user avatar
0 votes
0 answers
8 views

Clone of a uups proxy contract is not working

i have a factory contract which is creating clones of an NFT contract. if the NFT contract is not a proxy everything is ok and cloning works just fine. but since i need to have a upgradable UUPS NFT ...
Mostafa's user avatar
  • 51
0 votes
0 answers
15 views

Simple code example to implement tax on sell/buy transactions for a token on Uniswap DEX causing "Your swap is expected to fail.." error

I am trying to implement a sell/buy tax on transactions for my token when users trade on Uniswap DEX. My token's smart contract includes a tax deduction mechanism that functions correctly on EtherScan ...
Awais Ahmad's user avatar
0 votes
0 answers
9 views

call function uniswapv2 swapExactETHForTokensSupportingFeeOnTransferTokens return UniswapV2: INVALID_TO

i call the following function in js : function swapForShare(uint amountOut) public { uint ethBalanceBefore = address(this).balance; require(ethBalanceBefore > 0, "Contract ...
rebwar's user avatar
  • 3
0 votes
1 answer
12 views

Automate the use of approve() without having to do it manually

I'm taking my first steps on Solidity. I would like the user to be able to use their funds by calling the dapp functions, but without having to use the approve() function manually on the token ...
Francesco Rossi's user avatar
0 votes
1 answer
14 views

Why msg.value is not transferred to the owner?

I've deployed a simple wallet contract. The withdraw function goes like this.. function withdraw() external payable { require(msg.sender == owner, "Only Owner can withdraw"); ...
Valli Nayaki Chidambaram's user avatar
0 votes
1 answer
29 views

How does the contract handle tax deductions for simple buy and sell transactions when the token is listed on any decentralized exchange (DEX)?

Could anyone provide an example solidity smart contract code for how to implement tax deduction using a router in a smart contract when list on DEX ? I've noticed that when adding custom tax deduction ...
Awais Ahmad's user avatar
0 votes
1 answer
17 views

What makes an NFT be considered a wrapped NFT?

When you bridge an NFT let's say through Wormhole NFT bridge then on the destination chain it creates a wrapped NFT. This is done by deploying a separate ERC-721 contract for every unique combination ...
Surya M D G's user avatar
0 votes
0 answers
23 views

Buy Tax Error on uniswap

I did override the "_transfer" function from ERC20 that i can deduct taxes on buys / sells if users interact with my smart contract using Uniswap interface. Sells are working fine, but i ...
SolidityNewbie's user avatar
1 vote
1 answer
126 views

How to refer to a library in an interface?

The below code is a function of my smart contract. As you can see, its return data refers to a library. VoteLibrary is a library, and VoteCounting is a struct defined within it. Therefore, VoteLibrary....
Alireza's user avatar
  • 567
0 votes
1 answer
23 views

How to batch multiple calls through a single function?

I have a smart contract that implements monolithic functions. These functions are designed to do one job when called by a user. However, a user may be interested in batching multiple calls into a ...
smol-ninja's user avatar
0 votes
0 answers
13 views

call swapExactTokensForETH in javascript

I have the following function in JavaScript: try { let tx = await router.connect(receiver).swapExactTokensForETH( tokenAmountToSwap, 0, [token.address, await router.WETH()],...
rebwar's user avatar
  • 3
0 votes
1 answer
16 views

Inheritance in solidity

Are private variables in solidity inherited ? Please I need a bit of clarification here from most text I have read about inheritance in solidity they state clearly that private variables of parent ...
Emmanuel Anah's user avatar
0 votes
1 answer
17 views

Metamask transaction error

getting MetaMask - RPC Error: Function object could not be cloned. DOMException: Function object could not be cloned. after signing the transaction This is how i am signing the transaction this....
ashish0411's user avatar
0 votes
0 answers
13 views

Uniswap v3 IQuoter / IQuoterV2 return nothing

I'm trying to get Uniswap v3 IQuoter.quoteExactInputSingle() or IQuoterV2.quoteExactInputSingle()in Arbitrum / Base networks in my solidity contract. In both cases Remix show me that decoded output is ...
Rodion Krat's user avatar
0 votes
1 answer
16 views

I would like to know if with this code after deploy on REMIX IDE,it is possible swap my token in bnb,usdt,btc,eth and sol on Uniswap and Pancakeswap

// SPDX-License-Identifier: MIT pragma solidity ^0.8.24; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable....
Massimo Fornara's user avatar
0 votes
1 answer
24 views

Swapback issue with BEP20 contract

anothe rissue presents itself! My problem is with the swapback function: (the function is public because i was testing it, it should be internal) function swapBack() public swapping { uint256 ...
CFC's user avatar
  • 3
0 votes
1 answer
22 views

what is the way to find out if a selected token will revert at 0 transfer

How can I find out if the selected token will revert to 0 transfer? Is there a list of tokens that revert at 0 transfer. As far as I understand USDC is one of them, is that correct ? Thanks in advance!...
kane333's user avatar
1 vote
1 answer
24 views

assembly mload offset understanding

I tried asking chat-gpt but it kept shitting the be for the explaination. I have some code which looks like so: function getAuthorityScope(bytes memory authorityScope) public pure returns (address, ...
RitzyDevUk's user avatar
0 votes
1 answer
17 views

Failure to decode JSON

I'm trying to decode the following ZK proof, that lives in a JSON file, into a Solidity struct, using the Foundry book guide for JSON, but I'm getting continuous either errors or the wrong values: ...
dNyrM's user avatar
  • 928
1 vote
0 answers
13 views

Is it safe to use the Diamond Standard in 2024?

I am asking because I wonder if the libraries are mature enough. For non-upgradable contracts, for example, using the OpenZeppelin Contracts library is a no-brainer. Do you think this is the case for ...
FracaShaw's user avatar
0 votes
0 answers
12 views

How the deployer manages to call function manual swap on a burned liquidity renounced contract and drain more money selling tokens he didn't hold

Deployer sold his tokens and left the project. 10 days later I verify he made another sell from tokens that weren't on his deployer wallet. He called a function "manual swap" and somehow I ...
Martin Saints's user avatar
0 votes
0 answers
25 views

I'm working on a NFT Marketplace and help me with BUY function. It's not working?

I'm new to smart contracts and testing some functions. I'm trying on buy nft function. it's not working somehow. Even though I've enough balance, the crypto transfer is not happening. Please find the ...
Vara Prasad's user avatar
2 votes
1 answer
63 views

EIP-3448 really need the metadata length or is it optional?

If you check the specs of EIP-3448, it states: "The last 32 bytes (one word) of the bytecode must indicate the length of the metadata in bytes." However, if this is not included in the ...
Iftikhar uddin's user avatar
0 votes
1 answer
13 views

Account Abstraction on Private blockchain?

I want to know about that is it possible to implement account abstraction on private blockchain (POA) based geth client / Ganache client?
ProgrammerSK's user avatar
0 votes
1 answer
27 views

why is my loop not working in below solidity code

What's happening here in the code and why is my loop not working? And one more thing, should I remove all the warnings from my code before deploying? function sub(uint n, uint a) external pure returns(...
paaras bhardwaj's user avatar
1 vote
0 answers
23 views

How to precisely remove a specific amount of token0 or token1 liquidity from a Uniswap V2 Pair in Solidity

I need to remove an exact amount of token0 or token1 from a Uniswap V2 pair. To achieve this, I must calculate the amount of LP tokens to burn. The calculation formula is straightforward: Where: ...
CryptoBro's user avatar
1 vote
1 answer
19 views

Help Needed: Uniswap Not Finding My Recently Deployed Smart Contract

Help Needed: Uniswap Not Finding My Recently Deployed Smart Contract Hello everyone, I’m facing some issues with Uniswap and could really use your expertise. I recently deployed a smart contract for ...
Wail Haddad's user avatar
0 votes
1 answer
29 views

bundle transaction in bsc with contract address

i want to build bsc bundle like this contract address here is example https://bscscan.com/tx/0x934ad8417862a1e1e81a5b7ec4558f89877f06c33d3b2612293272eba437c869 https://bscscan.com/address/...
user3186594's user avatar
1 vote
0 answers
16 views

InvalidFEOpcode when running Hello ZoKrates

I'm trying to verify a proof by calling verifyTx() on the smart contract output given after running zokrates export-verifier, but it's reverting with the error InvalidFEOpcode on the code block: ...
dNyrM's user avatar
  • 928
0 votes
0 answers
17 views

Deploy script to anvil node foundry

Is it possible to simulate a contract deployment, using a script, to an anvil node but by specifying the localhost in the script itself instead of a flag on the CLI command? Instead of this: forge ...
dNyrM's user avatar
  • 928
0 votes
0 answers
9 views

I am not able to specify network in brownie run

I am not able to specify networks in brownie run. brownie run ./scripts/deployment_v2.py --network ropsten I get error TypeError: 'NoneType' object is not subscriptable error log: PS C:\Users\ADMIN\...
Udayarajan gauthaman's user avatar
1 vote
2 answers
25 views

How can I byte pack these datastructures in solidity to be more efficient?

I have a bunch of mappings that I want to optimize in my Solidity smart contract, is there a way that I can use byte-packing to reduce the size needed to store all the data in these mappings? ...
Barney Chambers's user avatar
0 votes
1 answer
26 views

Having issues swapping brett on base with my web3.py script

Here is my current code (not including abi because its gonna be to long) #Addresses PERMIT_ADDRESS = '0x000000000022D473030F116dDEE9F6B43aC78BA3' BRETT_ADDRESS = '...
vectorizedaynon's user avatar
0 votes
1 answer
32 views

How to get all my tokens from my contract

I need help getting all tokens in an array . I’m making a geo location based game, where a user can mint an NFT and then pin it to the map. Once the NFT is pinned it gets added to my NFTS array I want ...
piña's user avatar
  • 209
1 vote
1 answer
19 views

Why use circom circuits to generate solidity contracts, instead of directly writing the contract?

I am not able to understand why write a circom circuit and then use it to generate a solidity contract to be deployed. Instead, why not write the code directly in solidity. Is it because zero ...
Surya M D G's user avatar
0 votes
1 answer
25 views

For hardhat-deploy, How to upgrade contract

I can upgrade my contract with hardhat/upgrades. However, if I want to upgrade my contract with hardhat-deploy. How to deal with it? I just want to upgrade my contract deployed before. const ...
AndrewZzzz's user avatar
0 votes
1 answer
29 views

invalid BigNumber value for string

When I try to run the pin function that takes an integer, i keep getting an error invalid BigNumber value (argument="value", value=undefined, code=INVALID_ARGUMENT, version=bignumber/5.7.0) ...
piña's user avatar
  • 209
1 vote
2 answers
31 views

Is it possible to create a queue of transasctions?

I am wondering if it is possible to create a queue of transactions. In my case I want to add all incoming transactions to a queue and randomize which ones are completed and which ones are canceled. ...
Stavros Cotsoradis's user avatar

1
2 3 4 5
357