Refactor conversion function.

This commit is contained in:
chriseth
2021-08-05 11:48:35 +02:00
parent 26fb2317ef
commit 6b888b531b
3 changed files with 37 additions and 43 deletions
@@ -275,11 +275,7 @@ object \"C_54\" {
}
function convert_t_contract$_C_$54_to_t_address(value) -> converted {
converted := convert_t_contract$_C_$54_to_t_uint160(value)
}
function convert_t_contract$_C_$54_to_t_uint160(value) -> converted {
converted := cleanup_t_uint160(value)
converted := convert_t_uint160_to_t_address(value)
}
function convert_t_int256_to_t_int256(value) -> converted {
@@ -290,6 +286,14 @@ object \"C_54\" {
converted := cleanup_t_int256(value)
}
function convert_t_uint160_to_t_address(value) -> converted {
converted := convert_t_uint160_to_t_uint160(value)
}
function convert_t_uint160_to_t_uint160(value) -> converted {
converted := cleanup_t_uint160(value)
}
function extract_from_storage_value_dynamict_int256(slot_value, offset) -> value {
value := cleanup_from_storage_t_int256(shift_right_unsigned_dynamic(mul(offset, 8), slot_value))
}
@@ -875,11 +879,7 @@ object \"D_72\" {
}
function convert_t_contract$_C_$54_to_t_address(value) -> converted {
converted := convert_t_contract$_C_$54_to_t_uint160(value)
}
function convert_t_contract$_C_$54_to_t_uint160(value) -> converted {
converted := cleanup_t_uint160(value)
converted := convert_t_uint160_to_t_address(value)
}
function convert_t_int256_to_t_int256(value) -> converted {
@@ -890,6 +890,14 @@ object \"D_72\" {
converted := cleanup_t_int256(value)
}
function convert_t_uint160_to_t_address(value) -> converted {
converted := convert_t_uint160_to_t_uint160(value)
}
function convert_t_uint160_to_t_uint160(value) -> converted {
converted := cleanup_t_uint160(value)
}
function extract_from_storage_value_dynamict_int256(slot_value, offset) -> value {
value := cleanup_from_storage_t_int256(shift_right_unsigned_dynamic(mul(offset, 8), slot_value))
}
@@ -27,5 +27,5 @@ contract C {
// compileViaYul: also
// ----
// test() -> 9, 7
// gas legacy: 121594
// gas legacy: 125064
// t2() -> 9