Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stack too deep after adding an public map to a contract #14333

Open
migoldfinger opened this issue Jun 17, 2023 · 3 comments
Open

Stack too deep after adding an public map to a contract #14333

migoldfinger opened this issue Jun 17, 2023 · 3 comments
Labels

Comments

@migoldfinger
Copy link

I have a contract that has a lot of logic. I came to the point when I get Stack too deep exception.
In my search for the reason I came to a thing I can not get my head around.
The contract is way bigger but I copied the relevant part. The thing is how is it even possible that a defined public property effects the stack? And what would be possible solutions?
I already tried compile with and without viaIR.

contract PositionRouter
{
    using Address for address;
    using SafeERC20 for IERC20;

    struct DecreasePositionRequest {
        address account;
        address[] path;
        address indexToken;
        uint256 collateralDelta;
        uint256 sizeDelta;
        bool isLong;
        address receiver;
        uint256 acceptablePrice;
        uint256 minOut;
        uint256 executionFee;
        uint256 blockNumber;
        uint256 blockTime;
        bool withdrawETH;
        address callbackTarget;
    }
// Enabling this leads to Stack too deep
// mapping (bytes32 => DecreasePositionRequest) public decreasePositionRequests;
...
}
   
@web3-engineer
Copy link

I know you believe that this code is the only necessary one for debugg but can you give me the link of the entire smart contract ? You are calling out parameters that need to be in order with all the data in the smart contract.

@migoldfinger
Copy link
Author

@migoldfinger
Copy link
Author

Since I update the contracts that originally compiled with solidity ^0.6.0
BTW I solved the problem for the moment by adding pragma abicoder v1;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants