Linked Questions

0 votes
2 answers
25 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 ?
0 votes
1 answer
20 views

Foundry Compile Error [duplicate]

Error: Compiler error (C:\Users\circleci\project\libsolidity\codegen\CompilerUtils.cpp:1459):Stack too deep. Try compiling with --via-ir (cli) or the equivalent viaIR: true (standard JSON) while ...
324 votes
9 answers
114k views

`external` vs `public` best practices

Apart from the public modifier Ethereum introduces the external one. Both may be called outside of the contract and inside (the later one by this.f() pattern). Moreover, according to the docs: ...
7 votes
1 answer
7k views

Stack too deep when compiling inline assembly

I'm running into a YulException: Stack too deep when compiling inline assembly: Variable headStart is 1 slot(s) too deep inside the stack. using a smart contract that has this function. I took this ...
0 votes
1 answer
381 views

Mint and Create a Struct give me give me error "Stack too deep try removing local variables"

I have an issue with my code, I want to create a function to be able to Mint a token, and add a struct to represent all attributes of this token. The issue is, I have lot's of args on my function (8) ...
4 votes
0 answers
563 views

Block scoping in Solidity to avoid "Stack too deep error"

I have a quite big function with 16+ local variables which produces the infamous Stack too deep error. To handle this bad boy I have searched for the possible solutions and ended up using scopes. ...
0 votes
0 answers
38 views

CompilingError: Stack too deep, try removing local variables [duplicate]

I have a function that lists an NFT on a marketplace for sale. In the process, it keeps records by saving data in a struct inside nested maps represented by the NFT address and token ID. I am running ...
0 votes
1 answer
57 views

"now"this key word can use.how can i do

pragma solidity >0.4.0 ; pragma experimental ABIEncoderV2; // 代币系统 contract Token { uint tokenTotal; // 代币总和 uint tokenPrice; // 代币价格 uint balanceTokens; // 合约余额 // ...
0 votes
1 answer
950 views

Stack Too Deep Compiling Error on Remix -- Solidity [duplicate]

first off I’d like to say that I’m a noob in Solidity so this issue might sound so trivial, pls bear with me. I’m running into a compiler error on line 61 (Stack too deep). I suppose an easy fix would ...
0 votes
1 answer
39 views

InternalCompilerError: Stack too deep, try using fewer variables [duplicate]

Here is my code // SPDX-License-Identifier: MIT pragma solidity >=0.4.22 <0.9.0; contract GeoSpatialData{ uint public SpatialDataCount = 0; struct GeoData{ uint id; ...
0 votes
1 answer
502 views

How do I parse a bytes32 in solidty?

I have a bytes32 object in memory or storage and I want to parse it into little chunks, for example into one uint8, followed by a bool, followed by uint10, followed by address. How can one do that? I ...
0 votes
1 answer
1k views

CompilerError: Stack too deep, try removing local variables. How to solve the problem? [duplicate]

I'm having problems with this part of the code. Can you tell me how to solve this problem? I have read various documentation, but maybe someone knows the solution function _getValues(uint256 tAmount)...
0 votes
0 answers
25 views

Stack too deep, try removing local variables when using remix [duplicate]

while compiling in remix i get the above error: CompilerError: Stack too deep, try removing local variables. --> work/youkie.sol:1015:80: | 1015 | (uint256 rAmount, uint256 ...
2 votes
0 answers
1k views

Stack too deep when compiling inline assembly: Variable headStart is 1 slot(s) too deep inside the stack [duplicate]

I tried to add another parameter to my constructor and I get the following error when compiling with hardtest to test. If I remove one parameter it compiles again, so clearly it's related to the ...
1 vote
0 answers
15 views

Stack too deep error when trying to calculate two charity fees [duplicate]

How can I fix the below functions? I'm getting CompilerError: Stack too deep, try removing local variables. (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee,...

15 30 50 per page