solidity/test/libsolidity/semanticTests/array/push/nested_bytes_push.sol
Djordje Mijovic f0c5cdca9f [Sol->Yul] Adding util function to copy literal to storage.
Co-authored-by: Daniel Kirchner <daniel@ekpyron.org>

Co-authored-by: chriseth <chris@ethereum.org>
2021-05-05 11:33:03 +02:00

21 lines
483 B
Solidity

pragma abicoder v2;
contract C {
bytes[] a;
function f() public {
a.push("abc");
a.push("abcdefghabcdefghabcdefghabcdefgh");
a.push("abcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefgh");
assert(a[0][0] == "a");
assert(a[1][31] == "h");
assert(a[2][32] == "a");
}
}
// ====
// compileViaYul: also
// ----
// f() ->
// gas irOptimized: 181480
// gas legacy: 180320
// gas legacyOptimized: 180103