2020-03-09 21:14:07 +00:00
|
|
|
contract C {
|
|
|
|
bytes constant a = "\x03\x01\x02";
|
|
|
|
bytes constant b = hex"030102";
|
|
|
|
string constant c = "hello";
|
|
|
|
|
|
|
|
function f() public returns (bytes memory) {
|
|
|
|
return a;
|
|
|
|
}
|
|
|
|
|
|
|
|
function g() public returns (bytes memory) {
|
|
|
|
return b;
|
|
|
|
}
|
|
|
|
|
|
|
|
function h() public returns (bytes memory) {
|
|
|
|
return bytes(c);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-04-20 21:05:14 +00:00
|
|
|
// ====
|
2020-11-21 13:54:16 +00:00
|
|
|
// compileToEwasm: also
|
2021-03-12 23:02:36 +00:00
|
|
|
// compileViaYul: also
|
2020-03-09 21:14:07 +00:00
|
|
|
// ----
|
|
|
|
// f() -> 0x20, 3, "\x03\x01\x02"
|
|
|
|
// g() -> 0x20, 3, "\x03\x01\x02"
|
|
|
|
// h() -> 0x20, 5, "hello"
|