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-05-05 06:57:19 +00:00
|
|
|
// gas irOptimized: 181480
|
|
|
|
// gas legacy: 180320
|
|
|
|
// gas legacyOptimized: 180103
|