Skip to content

Error --via-ir #1486

Closed Answered by Abbasjafri-syed
Abhishek-2416 asked this question in Q&A
Mar 16, 2024 · 4 comments · 13 replies
Discussion options

You must be logged in to vote

hey,
was getting this error also...finds that Stack too deep error is thrown by the Solidity compiler when any function have lots of local variables, have complex logical expressions or have a deep function stack..

The main issue is due to using lot of local variable in setup of raffle test which can be mitigated by dividing it into 2 parts like below:


    function setUp() public {
        // setting function for test
        deployRaffle deploy_raffle = new deployRaffle(); // deploying raffle contract through script
        (raffle, helper_mode) = deploy_raffle.run(); // assigning contract saved to their type

        (chainlink_Feed, price, coordinator_vrf, hash,,,,) = helper_mode.acti…

Replies: 4 comments 13 replies

Comment options

You must be logged in to vote
12 replies
@Abhishek-2416
Comment options

@EngrPips
Comment options

@Abhishek-2416
Comment options

@Abbasjafri-syed
Comment options

Answer selected by Abhishek-2416
@Abhishek-2416
Comment options

@Abbasjafri-syed
Comment options

@Abhishek-2416
Comment options

@Abhishek-2416
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@EngrPips
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants