current position:Home>Stack too deep, try removing local variables.

Stack too deep, try removing local variables.

2022-02-03 23:26:13 Q & A of Denglian community

1. Look at the Articles in the community , There is a way to handle it with braces , I think it's very convenient , I put curly braces around where I defined variables and found it useless ,guess.png Please tell me how to use this brace to be effective ?

2. Not quite understand 16 How does one count

// SPDX-License-Identifier: MITpragma solidity 0.7.1;contract StackTooDeepTest1 {    function addUints(        uint256 a,uint256 b,uint256 c,uint256 d,uint256 e,uint256 f,uint256 g,uint256 h,uint256 i    ) external pure returns(uint256) {        return a+b+c+d+e+f+g+h+i;    }}

For example, this code input parameter 9 No problem , Why do you press 9 Individual calculation , instead of 1 individual ?

3. If contract function A It calls another function B, function B There is one in and one out , Then these two parameters also count in A Of 16 Inside ?






Other answers 1:

copyright notice
author[Q & A of Denglian community],Please bring the original link to reprint, thank you.
https://en.netfreeman.com/2022/02/202202032326109216.html

Random recommended