2021-01-13 17:33:49 +00:00
|
|
|
pragma abicoder v2;
|
|
|
|
contract C {
|
|
|
|
bytes[] a;
|
|
|
|
|
|
|
|
function f() public {
|
|
|
|
a.push("abc");
|
2021-05-05 06:57:19 +00:00
|
|
|
a.push("abcdefghabcdefghabcdefghabcdefgh");
|
|
|
|
a.push("abcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefgh");
|
2021-01-13 17:33:49 +00:00
|
|
|
assert(a[0][0] == "a");
|
2021-05-05 06:57:19 +00:00
|
|
|
assert(a[1][31] == "h");
|
|
|
|
assert(a[2][32] == "a");
|
2021-01-13 17:33:49 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
// ====
|
|
|
|
// compileViaYul: also
|
|
|
|
// ----
|
2021-03-12 23:02:36 +00:00
|
|
|
// f() ->
|
2021-07-01 12:17:27 +00:00
|
|
|
// gas irOptimized: 179867
|
2021-05-18 13:39:08 +00:00
|
|
|
// gas legacy: 180620
|
|
|
|
// gas legacyOptimized: 180403
|