2019-06-06 12:07:40 +00:00
|
|
|
contract C {
|
2019-09-18 13:38:38 +00:00
|
|
|
uint[] storageArray;
|
2019-11-07 20:22:58 +00:00
|
|
|
function set_get_length(uint256 len) public returns (uint256) {
|
|
|
|
while(storageArray.length < len)
|
|
|
|
storageArray.push();
|
2019-09-18 13:38:38 +00:00
|
|
|
return storageArray.length;
|
|
|
|
}
|
2019-06-06 12:07:40 +00:00
|
|
|
}
|
|
|
|
// ====
|
|
|
|
// compileViaYul: true
|
|
|
|
// ----
|
|
|
|
// set_get_length(uint256): 0 -> 0
|
|
|
|
// set_get_length(uint256): 1 -> 1
|
|
|
|
// set_get_length(uint256): 10 -> 10
|
|
|
|
// set_get_length(uint256): 20 -> 20
|
|
|
|
// set_get_length(uint256): 0xFF -> 0xFF
|
2019-09-18 13:38:38 +00:00
|
|
|
// set_get_length(uint256): 0xFFF -> 0xFFF
|
2019-12-04 12:13:05 +00:00
|
|
|
// set_get_length(uint256): 0xFFFFF -> FAILURE # Out-of-gas #
|