Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.5.1+commit.c8a2cb62.js&optimize=false&gist=
pragma solidity ^0.5.0;
contract Configuration {
uint256 public val1 = 1;
uint256 public val2 = 2;
uint256 public val3 = 3;
uint256 public val4 = 4;
uint256 public val5 = 5;
uint256 public val6 = 6;
uint256 public val7 = 7;
uint256 public val8 = 8;
uint256 public val9 = 9;
uint256 public val10 = 10;
uint256 public val11 = 11;
uint256 public val12 = 12;
uint256 public val13 = 13;
uint256 public val14 = 14;
uint256 public val15 = 15;
uint256 public val16 = 16;
uint256 public val17 = 17;
uint256 public val18 = 18;
uint256 public val19 = 19;
uint256 public val20 = 20;
}
contract LotsaValuesConfig {
uint256 public result;
function initialize(Configuration _config) public {
result =
_config.val1() +
_config.val2() +
_config.val3() +
_config.val4() + // Stack too deep occurs here.
_config.val5() +
_config.val6() +
_config.val7() +
_config.val8() +
_config.val9() +
_config.val10() +
_config.val11() +
_config.val12() +
_config.val13() +
_config.val14() +
_config.val15() +
_config.val16() +
_config.val17() +
_config.val18() +
_config.val19() +
_config.val20();
}
}
contract LotsaValuesParams {
uint256 public result;
function initialize(
uint256 _value1,
uint256 _value2,
uint256 _value3,
uint256 _value4,
uint256 _value5,
uint256 _value6,
uint256 _value7,
uint256 _value8,
uint256 _value9,
uint256 _value10,
uint256 _value11,
uint256 _value12,
uint256 _value13,
uint256 _value14,
uint256 _value15,
uint256 _value16,
uint256 _value17,
uint256 _value18,
uint256 _value19,
uint256 _value20
)
public
{
result =
_value1 +
_value2 +
_value3 +
_value4 +
_value5 +
_value6 +
_value7 +
_value8 +
_value9 +
_value10 +
_value11 +
_value12 + // Stack too deep occurs here.
_value13 +
_value14 +
_value15 +
_value16 +
_value17 +
_value18 +
_value19 +
_value20;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment