[Sol - Yul] Add support for ABIDecode.

This commit is contained in:
Alexander Arlt
2020-05-26 13:30:37 -05:00
parent 50b200a5d5
commit 118cb13476
11 changed files with 62 additions and 1 deletions
@@ -4,5 +4,7 @@ contract C {
}
}
// ====
// compileViaYul: also
// ----
// f(bytes): 0x20, 0xc0, 0x20, 0x4, 0x3, 0x4, 0x5, 0x6 -> 0x20, 0x4, 0x3, 0x4, 0x5, 0x6
@@ -8,5 +8,7 @@ contract C {
}
}
// ====
// compileViaYul: also
// ----
// f(bytes): 0x20, 0xc0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6 -> 1, 2, 3, 4, 5, 6
@@ -11,5 +11,7 @@ contract C {
}
}
// ====
// compileViaYul: also
// ----
// f(bytes): 0x20, 0xc0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6 -> 1, 2, 3, 4, 5, 6
@@ -4,5 +4,7 @@ contract C {
}
}
// ====
// compileViaYul: also
// ----
// f(bytes): 0x20, 0x20, 0x21 -> 33
@@ -5,5 +5,7 @@ contract C {
}
}
// ====
// compileViaYul: also
// ----
// f() -> 0x21, 0x40, 0x7, "abcdefg"
@@ -5,5 +5,8 @@ contract C {
f = abi.decode(msg.data[4 + 32 : 4 + 32 + 32], (uint256));
}
}
// ====
// compileViaYul: also
// ----
// f(uint256,uint256): 42, 23 -> 42, 23, 42, 23
@@ -18,6 +18,9 @@ contract C {
}
}
}
// ====
// compileViaYul: also
// ----
// test(bytes): 0x20, 0x80, 0x40, 0x60, 0, 0 -> false, false
// test(bytes): 0x20, 0xC0, 0x40, 0x80, 1, 0x42, 1, 0x42 -> false, false
@@ -7,5 +7,8 @@ contract C {
return abi.decode(data, (uint256, bytes));
}
}
// ====
// compileViaYul: also
// ----
// f(bytes): 0x20, 0x80, 0x21, 0x40, 0x7, "abcdefg" -> 0x21, 0x40, 0x7, "abcdefg"
@@ -3,5 +3,8 @@ contract C {
return abi.decode(data, (uint256, bytes));
}
}
// ====
// compileViaYul: also
// ----
// f(bytes): 0x20, 0x80, 0x21, 0x40, 0x7, "abcdefg" -> 0x21, 0x40, 0x7, "abcdefg"
@@ -6,5 +6,6 @@ contract C {
return abi.decode(data, (uint256, bytes));
}
}
// ----
// f(bytes): 0x20, 0x80, 0x21, 0x40, 0x7, "abcdefg" -> 0x21, 0x40, 0x7, "abcdefg"