2024-05-21 12:34:37 +00:00
|
|
|
get slice ascii_slice() {
|
2022-05-19 15:32:07 +00:00
|
|
|
return "string";
|
|
|
|
}
|
|
|
|
|
2024-05-21 12:34:37 +00:00
|
|
|
get slice raw_slice() {
|
2022-05-19 15:32:07 +00:00
|
|
|
return "abcdef"s;
|
|
|
|
}
|
|
|
|
|
2024-05-21 12:34:37 +00:00
|
|
|
get slice addr_slice() {
|
2022-05-19 15:32:07 +00:00
|
|
|
return "Ef8zMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzM0vF"a;
|
|
|
|
}
|
|
|
|
|
2024-05-21 12:34:37 +00:00
|
|
|
get int string_hex() {
|
2022-05-19 15:32:07 +00:00
|
|
|
return "ABCDEFGHIJKLMNOPQRSTUVWXYZ012345"u;
|
|
|
|
}
|
|
|
|
|
2024-05-21 12:34:37 +00:00
|
|
|
get int string_minihash() {
|
2022-05-19 15:32:07 +00:00
|
|
|
return "transfer(slice, int)"h;
|
|
|
|
}
|
|
|
|
|
2024-05-21 12:34:37 +00:00
|
|
|
get int string_maxihash() {
|
2022-05-19 15:32:07 +00:00
|
|
|
return "transfer(slice, int)"H;
|
|
|
|
}
|
|
|
|
|
2024-05-21 12:34:37 +00:00
|
|
|
get int string_crc32() {
|
2022-05-19 15:32:07 +00:00
|
|
|
return "transfer(slice, int)"c;
|
|
|
|
}
|
|
|
|
|
2024-05-03 10:26:57 +00:00
|
|
|
builder newc() pure asm "NEWC";
|
2022-05-19 15:32:07 +00:00
|
|
|
slice endcs(builder b) asm "ENDC" "CTOS";
|
2024-05-03 10:26:57 +00:00
|
|
|
int sdeq (slice s1, slice s2) pure asm "SDEQ";
|
2022-05-19 15:32:07 +00:00
|
|
|
|
|
|
|
_ main() {
|
|
|
|
slice s_ascii = ascii_slice();
|
|
|
|
slice s_raw = raw_slice();
|
|
|
|
slice s_addr = addr_slice();
|
|
|
|
int i_hex = string_hex();
|
|
|
|
int i_mini = string_minihash();
|
|
|
|
int i_maxi = string_maxihash();
|
|
|
|
int i_crc = string_crc32();
|
|
|
|
throw_unless(101, sdeq(s_ascii, newc().store_uint(0x737472696E67, 12 * 4).endcs()));
|
|
|
|
throw_unless(102, sdeq(s_raw, newc().store_uint(0xABCDEF, 6 * 4).endcs()));
|
|
|
|
throw_unless(103, sdeq(s_addr, newc().store_uint(4, 3).store_int(-1, 8)
|
|
|
|
.store_uint(0x3333333333333333333333333333333333333333333333333333333333333333, 256).endcs()));
|
|
|
|
throw_unless(104, i_hex == 0x4142434445464748494A4B4C4D4E4F505152535455565758595A303132333435);
|
|
|
|
throw_unless(105, i_mini == 0x7a62e8a8);
|
|
|
|
throw_unless(106, i_maxi == 0x7a62e8a8ebac41bd6de16c65e7be363bc2d2cbc6a0873778dead4795c13db979);
|
|
|
|
throw_unless(107, i_crc == 2235694568);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
{-
|
|
|
|
TESTCASE | 0 | | 0
|
2024-04-27 09:32:16 +00:00
|
|
|
|
2024-05-10 13:08:50 +00:00
|
|
|
@code_hash 13830542019509784148027107880226447201604257839069192762244575629978154217223
|
2022-05-19 15:32:07 +00:00
|
|
|
-}
|